It’s frustrating to look at LeetCode’s 1500+ problems while getting stuck finding permutations of a string at the same time. How am I ever gonna get that dream job? I’m tired of my friends updating their
status bragging about their new jobs. I need the shortest path algorithm for getting a job.
We’ve looked at over a thousand interviews (data here), searching for patterns, and here’s what we found that we think can really help you speed up the process.
You Don’t Need to Know Manacher’s Algorithm
Or Bellman-Ford-Moore Algorithm, or Kruskal’s ALgorithm, or Dijkstra’s Algorithm or KMP Algorithm… Coding interviews almost never touch these “academic algorithms”. Researchers spent years coming up with complex algorithms like these and it’s not something you are to figure out at a 45 min interview. A good-enough rule of thumb is an algorithm that’s named after a person(s) you can safely ignore. You may see people discussing it in the forum, but we can safely tell you from data you don’t need to know these algorithms. So save yourself some time and focus on the important stuff.
I Can’t Solve LeetCode Hard Problems
The good news is you don’t have to. 80%+ of the problems you encounter at real interviews are easy and medium problems. So practice easy until you can solve them like a walk down the street. And then focus your effort on medium problems. It’s much worse to fail to code a medium problem bug-free at an interview than to fail to code a hard problem. Also remember you are compared to other candidates who likely also find hard problems difficult.
What Language Should I use?
Use whatever you are most comfortable with. Unless your job requires it, it is very rare for companies to ask you to use a specific language for interviews. That being said, we think python is the easiest choice for interviews thanks to its terse syntax. You probably save 5–10 min of typing/writing, which is a meaningful amount for a 45 min interview.
How Do I Know If I’m Ready for Interviews?
A good rule of thumb is: if you can consistently solve random medium problems within 30 min and within 3 submissions then you should be ready to go to interviews. 30 min because the interview is typically 45 min and you are expected to interact with the interviewer during that time. 3 submissions limit because interviews typically look for bug-free candidates.
How Many Problems Do I need to solve to get a job?
To answer this question, let’s take a trip down the memory lane.
Pre-2014, all you have to do to get a job is reading the book “Cracking the Coding Interview”. It has about ~150 problems and that’s all you need.
In 2014, LeetCode was started. “Two sum”, the “Hello World” coding interview “Two Sum” was the first problem.
By 2015, there were about 200 problems on LeetCode. Interviews at this time are still mostly around basics like Two Pointers, Linked List and Binary Tree Traversal. If you have done 100 problems on LeetCode you’re more than covered for your interviews.
From 2016 to 2018, things are up and people are hopeful in Silicon Valley. Engineering salary is going up and more people are going into software engineering. We start seeing more complex topics such as Depth-first search and even dynamic programming.
From 2019 to 2020, things start to turn sideways. Tens of thousands of people are laid-off. LeetCode now has 1500+ problems. Topic-wise, Depth-first search, Breadth-first search, Two Pointers are still the favorite.
The gist of the story is
It’s more important to master the topics/patterns than trying to do maximize number of problems you do
That being said you probably need to solve 150–200 problems to master the patterns. It’s most efficient to learn all the important patterns first and then practice more problems.
Where Can I Find These Patterns
Head over to ALGOMONSTER