You know what I friggin’ hate?
“To understand recursion, one must understand recursion.”
And I’m not alone either. This was one of the survey responses when I asked my readers about recursion:
Whenever I see someone make this “joke”, they get a dry, sarcastic laugh from me.
Ha. Ha.
Seriously, if I had a bitcoin for every time…
But I digress. Here’s the thing about statements like this: They display a lack of true understanding.
It’s the same as saying “recursion is just breaking down a problem into subproblems” or “recursion is just a function that calls itself”.
Sure. Those are both valid statements, but how do they help you use recursion? How the hell do you break down a permutation problem to begin with?
Imagine this…
You’ve been studying for weeks for your upcoming interview at Facebook. It’s been years since you’ve had to do any data structures and algorithms, but you went back to your sophomore year class notes to really make sure that you were covering your bases.
You went over graphs and trees – gotta remember how to implement Dijkstra’s algorithm.
You studied system design – you could design a messaging app or TinyURL in your sleep.
You covered recursion – Fibonacci? No problem. Factorial? Check!
The day of reckoning is finally here. Of course you’re nervous, why wouldn’t you be? But at the same time, you know you’ve done everything you can to prepare. You walk into your first interview…
And that’s where the problems start.
“Write a function to find all permutations of a list.”
I guess we could use a for loop to loop over each choice for each item in our list…
But then we would need to have n nested for loops…
I think I remember something about doing this recursively…
Are we supposed to swap items somehow? But if we swap them then how the hell does that actually work?
And what is our base case anyway? And how are we breaking down the problem?
You fumble your way through the problem. Ultimately, you’re able to piece together a solution, and about 45 minutes later, you wrap up the question on the whiteboard, have a friendly chat with you interviewer, and go on your merry way.
The interview definitely left you a little spooked – that was harder than you expected, especially given how much you studied – but you continue on to do well on all the rest of your interviews.
Leaving Facebook campus at the end of the day, you feel good. Sure everything didn’t go perfectly, but it went better than you expected and you have confidence that you’re going to get an offer.
Two days later, you get a cold, formulaic rejection email.
You know why?
Remember that permutation problem that took you 45 minutes?
Well it turns out, they were expecting more. What you found to be a challenging problem was actually part 1 of what should have been a 3 part interview. When you struggled on the EASY part, they skipped the rest.
So what happened? Why did you struggle so much on this simple problem?
Simply put, no one ever taught you how to really do recursion. In school, you learn the same basic concepts.
→ Break down the problem into subproblems.
→ Write a function that calls itself.
→ Find the base case and recursive step.
→ “Look how easy it is to do Fibonacci and Factorial”.
But you’re missing the most important part! No one ever teaches you how to apply what you’re learning.
Instead of coming into the interview with a clear, step-by-step strategy, you stare at the problem and fumble around until you kinda sorta come up with a solution.
All you’re taught is how to regurgitate solutions to simple recursive problems.
But guess what? Those aren’t the questions interviewers ask.
Interviewers don’t care if you can repeat solutions that you’ve seen before. They care whether you can come up with new solutions. They care about your problem solving skills.
And unfortunately no one teaches you to think about recursion.
Recursion is one of those topics where you are taught the bare minimum and then expected to go out on your own and figure it out.
That would be like you asking for directions to drive to the grocery store 3 miles away and me vaguely pointing and saying “that way”. You’ll get there eventually. After stopping to ask for directions. And doubling back a few times. And getting hopelessly lost.
What if instead, I took the time to actually draw you a map. I could show you which way to turn at which intersection so that you can get to the store by the fastest route? I’ve been there before, so I know how to get there.
Now I know for driving directions, this is obvious. We’ve all used Google Maps.
But I’m here to show you the “Google Maps” of recursion.
In fact, over the last 3 months, I’ve gone through literally dozens of the most common recursion problems to find the patterns that tie each problem together. I’ve spent months identifying common threads so that I can really understand how to approach any recursive problem and successfully find a solution.
I’ve worked with an intrepid group of student explorers to develop a roadmap that you can follow so that recursion is no longer something to fear.
Multiple students found that by using this roadmap, they began to actively enjoy using recursion and started seeking out places that they could use it in their interviews.
Recursion is now something I can comfortably say I’ll be using a lot more when I now go back into taking on more problems on HackerRank.
– Peter K.
Imagine if you had a clear picture of how to solve any recursive problem. When you go into your interview with any company, you can have confidence walking in and holding your head high, knowing for a fact that you’re going to come out having blown them away.
Imagine that you could sleep comfortably at night knowing that no interview problem is too challenging for you to solve.
Imagine coming home from your interviews to your phone ringing off the hook with recruiters tripping over each other to give you a job offer.
The best candidates have their pick of the good jobs
Imagine recruiters fighting over you, giving you the chance to negotiate tens of thousands of $$$.
Imagine walking down Hacker Way for the first day of your shiny new job!
All of this is possible… but not unless you become a master of recursion.
Now, it is certainly possible to master recursion on your own.
As a matter of fact, here’s what I did:
You’re more than welcome to follow in my footsteps.
You could google around and find what articles you can on recursion. Then you can filter through the mess of fibonacci and factorial crap to possibly find something useful. If you go through the articles, you’ll probably be able to piece everything together – if you dig through the hundreds of pages it takes to get there.
You could go on Leetcode and memorize the solution to every recursive problem. That might work, in the off chance that you get asked one of those exact questions. Or after the 40th problem, you may start to recognize some patterns. But do you really want to risk losing a job because you were too lazy to go more than surface deep?
You could go to the source and study the mathematical theory. Once you understand induction and theoretical proofs, you may be able to use that to develop algorithms to solve some of these recursive problems. That’s some crazy hard, Ph.D-level crap though.
However, these are all incredibly time consuming solutions. Do you really have time for this? Your interview is coming up soon. You’re working a fulltime job. The last thing you need to do is redo all this work that I’ve already done for you.
Rather than trying to figure everything out on your own, let me share my tried and true strategies with you!
What if recursion was as easy for you as it is for everyone else? Everyone else can get whatever job offer they want and you’re stuck here muddling through function calls.
It’s basically hieroglyphics…
I used to think there was a natural pecking order. That some people were just smarter than others…
…but as I began to dig deep into recursion, I realized I was wrong.
Going through problem after problem, patterns started to emerge. The dots started to connect. And that’s when I realized… these people aren’t actually any smarter than me.
They didn’t have any special skills. They weren’t uniquely gifted. They just literally knew something that I didn’t.
They had the cheat codes.
And that’s what this course is. It’s the hacks that no one shows you. The ones that everyone else either doesn’t know or don’t realize they’re using…
Here are just a few of the things you’ll learn in this course:
The deeper I dug into the recursion, the more I began to see what felt like secret patterns that unlocked the solutions to each problem.
It always seemed like every problem was completely different. Every interview question was a fresh hell…
But then I realized that there were 6 – only 6 – patterns that I needed to know. Armed with these, I had solved 70% of any problem before I even started…
Imagine if you only had to do 30% of the work of everyone else! It’s almost unfair.
I kept getting stuck. I wanted to learn how a problem worked, but I would look at the code and it was so over my head. That’s when I found this little-known strategy for dissecting any recursive code and revealing it’s true meaning…
With this technique, we can look under the hood and see what is really going on in any recursive code. We can learn from the masters… and become masters ourselves.
I used to try to find the time complexity of recursive and the best I could come up with was O(WTF)
.
As I discovered the patterns of recursive problems, I also found one clever little trick that completely changed everything. With this trick, you don’t have to compute the time complexity at all 99% of the time.
This formula gives you the time complexity for any recursive problem in seconds flat.
Coding Interview Mastery: Recursion isn’t just a collection of random recursive problems. It’s not hours of boring lectures about everything known to man about recursion.
You don’t have time for that.
I don’t have time for that.
That’s why I’ve condensed exactly what you need to know into this 7 module intensive training course. No fluff. Just exactly what you need so that you get get back to interviewing.
In each module, we break down one of the core recursive patterns and go deep. You will learn the pattern and then see multiple examples of exactly how to apply it. I’ll show you exactly how to use these cheat codes to unlock any recursive problem your interviewer can throw at you.
You’ll also have homework. This will drill the concepts into your head so that you can’t possibly forget them. Each question is carefully chosen to reinforce a specific point. Again, no fluff.
“[My favorite aspect of the course was] definitely the exercises, the homework. [They] started from the easiest, but still within the same lesson there was, I mean that the last homework exercise was usually the most difficult one. And I think it was beyond the comfortable level for me, so that I really had to challenge myself usually with the last one… I think it was good that it was a challenging part of that course, so really push myself.”
– Jaro K.
And because I know that we sometimes get busy, I’m giving you lifetime access to this course.
In Module 1, you will learn all the foundations of recursion that you will need and we’ll make sure that everybody is starting on the same page. This isn’t a beginner course, but we’ll quickly review all the basics.
Some of the things we’ll cover:
In Module 2, we’ll explore the first recursive pattern – Iteration. We’ll learn how to iterate over a variety of data structures using recursion, both in one and multiple dimensions.
Some of the things we’ll cover:
Now we’re getting into the good stuff. In Module 3 we’ll go over the most fundamental pattern in all of recursion: Subproblems.
Some of the things we’ll cover:
One of my favorite topics. The selection pattern is one of the most commonly occurring patterns that you will see in your interview and is fundamental to understanding dynamic programming. We’ll see many of the classic problems you may be asked here.
Some of the things we’ll cover:
In Module 5, we’ll cover Ordering and learn how to use permutations to solve many common recursive problems. This module dovetails nicely with Module 4 and we’ll be able to reapply a lot of similar concepts.
Some of the things we’ll cover:
In this module, we will go deep into the Divide & Conquer pattern and see two common subpatterns that will be critical to your interview success.
Some of the things we’ll cover:
In this last module, we’ll cover some of the most advanced topics. This is what we’re building toward and these are the kinds of problems that will make you really shine above the rest.
Some of the things we’ll cover:
Big Oh complexity is one of the hardest parts of recursion. During the course, I’ll be showing you my best tricks for computing recursive time complexities with ease… but we’re not going to have a chance to go into all the math.
This masterclass will go deep into the math and reasoning behind recursive time complexities. I’ll take you deep into my exact thought processes when I see a new problem and how I compute any time complexity with confidence.
No more guessing and hoping against hope your interviewer doesn’t see your lack of confidence.
This course covers A LOT of different recursive problems. More than 30 in fact.
If you really want to master these strategies, you need to experiment for yourself. That’s why I’ve provided complete downloadable solutions for every single problem. I’ve even included multiple solutions for some of them so that you can decide what works best for you!
What do you do when you have questions about interviewing?
Ask a friend? Do they really have the answers?
Hire a coach? That’s pretty expensive.
Read a book? That’s not really answering your question.
That’s what makes this bonus so friggin’ special. No more wasting your time and money trying to get advice. When you join the Pro version of this course, you get access to 2 exclusive master calls recordings.
These group Q&A calls were held over Zoom in a webinar format and I answer many of the most common questions that students had as they went through the course.
I have spent months developing this material and had dozens of students experience incredible successes using these recursive strategies. I know this tested methodology works. However, if you work through the course material and don’t get positive results, email me and I will refund your money 100%.
Are you ready to master recursion today?
How is this course different from Coding Interview Mastery: Dynamic Programming?
CIM: Dynamic Programming is a laser focused course on the dynamic programming specifically. While recursion is involved in dynamic programming, there are large areas of recursion that are not related to dynamic programming at all.
This course covers the full breadth of recursion. If you’ve already joined, or are thinking about joining CIM: Dynamic Programming, this course will cover all the prerequisites so that you can really knock both recursion and dynamic programming out of the park.
Are there any prerequisites to this course?
This course is accessible to anyone with strong computer science fundamentals – it’s not for beginners.
In this course, we’ll be moving very quickly through the material. There’s a lot to cover in the time we have. Therefore, a strong foundation is a must.
Having a basic familiarity with how recursion works will help. The goal of this course is not to teach you what recursion is, but to show you how to effectively use it as a tool in your interviews.
Why should I pay when there are so many free/cheap options out there?
Yep, there are other options out there that will cost you less money in the short run. But ask yourself, “How much is getting my dream job worth?”
This course will not just give you solutions to memorize, but really teach you the mental frameworks you need to work through these problems, giving you the opportunity to truly succeed at your interviews.
What language is this course in?
This course is primarily taught in Java. However, the concepts are universal. As long as you have basic comprehension of Java, you will be able to apply the content to the language of your choosing.
There are also code samples available in other languages (like Python) that you can refer to.
Here’s what some students have said about the course:
“I didn't realize that it's possible to be so systematic about recursion. Now, here's the thing, you throw a recursion problem at me, I'm going to figure it out. I had done it enough that I have a feel but it never really occurred to me to think about it in a systematic way.”
“When this course started, I can say I was 20%, 25% confident. Not confident, I was not at ease with recursion. I can solve maybe 1 problem partially out of 10 problems. But as soon as the course kept on progressing, this confidence level raised to approximately 30%, 35%. Now I can solve all the questions, at least I can attempt all the questions, and I can solve at least 60% of them. And the examples work you have give, the homework exercises, those were really helpful. Because each example exercise covered some form of pattern, which you can apply to certain problems. So I found that very helpful”
“I was happy with the course, mainly because being a self taught developer, recursion was one of those things that you can always do iteratively and iterative always made more sense to me, so I always knew how to do DFS, searching and all that iteratively, but when it came to implementing recursively, everyone was always saying, ‘Oh, it's trivial.' The iterative is a hard version, but to me, it was the complete oposite. So, I do feel that doing more exercises and more targeted exercises like that did help for the recursion.”
“Working through the problems like when you work through an example, for me was really, really huge. Like the cornerstone piece was that… Working through the problems by hand. I think that was really invaluable. I would not trade that for anything. It was painful, very painful process for the big problems, but I wouldn't trade that knowledge”
Before you go, I want to tell you a quick story.
When I was in college studying computer science, as well as after I graduated and started my career as a software developer, there was a pervasive idea. I don’t think anyone said it outright, but it was definitely something I was led to believe: Software engineers do everything for themselves.
No one had to say it, but it was visible in the culture.
“Oh you don’t need a book, just read the documentation and figure it out.”
“I wanted a tool to make such-and-such simpler so I just coded it up myself.”
“RTFM”
The implication is that software engineers don’t buy things. They don’t take shortcuts. The only way to succeed is the long way.
While I was researching this course, I came across a Reddit post whose comments perfectly reflected this idea. The OP was asking what he could do beyond simple practice to improve his recursion skills faster:
Well I’m here to tell you that there is a way. If there’s one thing that I’ve learned from building this business, it’s that you can make exponentially more progress by investing in yourself.
Whether you read books, take courses, or find a coach, learning from someone who has done what you want to do is the best way to get ahead quickly. This is the greatest shortcut there is to success.
Your time is valuable. You could spend years learning recursion if you really want, but that’s just not necessary. This course will teach you everything that I spent years learning in a fraction of the time, letting you get back to the rest of your studying.
Ultimately, how much do you want the job? If you’re truly serious, then this is the best way to get there. You can try to learn recursion on your own, but you will spend hours and may still not get to where you want to go. If you invest in yourself now, you will never have to worry again about failing an interview because of recursion. You’ll quickly get to where you need to be and then you can go back to studying everything else.
Everyday you delay, you’re competing for jobs with people who are recursion pros. Your dream job is out there and it’s yours to take.
© 2019 Byte by Byte • Terms and Conditions • Privacy Policy