This article expands on a well-known interview prep document, 14 Patterns to Ace Any Coding Interview (“14 Patterns”), by providing a more limited starting point, a more inclusive destination, and updated guidance along the way.
14 Patterns is useful as a prep tool for Leetcode-style data structures and algorithm (“DS&A”) interviews. Leetcode-style DS&A interviews and System Design Interviews make up much of the broader category called Whiteboard Interviews, a style of technical interview that traditionally involves a physical whiteboard in the context of an in-person interview. This style of interview is standard for a Big Tech (aka Big N or Tier 1) interview cycle. While much of the interview process is conducted remotely these days, the term has stuck.
These interviews typically have a few common elements:
Whiteboard interviews have had some pushback. The Hiring Without Whiteboards GitHub repository is an excellent source regarding companies that don’t incorporate whiteboard interviews and information on the approaches they use instead.
14 Patterns can be overwhelming to the newcomer. This is a particularly high barrier of entry to a non-traditional or self-taught programmer. Is there any way that we could cut down the number of things to learn, or at least prioritize among these patterns? Yes! Leetcode provides the frequency at which their questions have been seen in actual interviews. Let’s prioritize those patterns that are most frequently used as the highest value and most important to learn first.
Let’s also make sure that our strategy is informed by multiple resources, not just the 14 Patterns. GeeksforGeeks provides a similar DS&A prep resource called Top 10 Algorithms in Interview Questions. The GeeksforGeeks advice overlaps with the 14 Patterns, so we essentially have 10 algorithms recommended by both sources and 4 patterns recommended only within the 14 Patterns. It is noteworthy that the GeeksforGeeks article was provided to me by Uber for official interview preparation.
GeeksforGeeks goes on to group their 10 algorithms into 8 topics. We can use Leetcode frequency data to eliminate the least common two topics. In addition, I eliminate the dynamic programming topic based on consultation with Big Tech career coaches at interviewing.io and reinforced by discussions on Blind. Dynamic programming questions are going through a soft deprecation in Big Tech because they are known to be time-consuming and provide a poor signal of candidate quality during the interview.
Specifically, we eliminate these three low-value topics:
To arrive at the Top 5 Patterns:
As someone preparing for DS&A, I would begin with these five. Search Leetcode for three easy questions under each topic. Complete one topic per day. Next, use the Blind 75 to reinforce these same topics. After eliminating low-value topics from the Blind 75, we are left with 7 high-value topics. These topics are actually not different from the Top 5 Patterns, they are just grouped in a slightly different way:
Again, complete three easy questions from each topic, and complete one topic per day. Once I have completed these steps, I would complete a medium from each topic before I worry about moving on to learn new patterns. Then, I would move on to the 14 Patterns. Once I have learned all fourteen patterns to the medium level, I can turn to another great resource to expand my pattern set to 22.
The excellent resource I am speaking about is the Leetcode Patterns Tool from Sean Prashad. This tool sources eight additional patterns by analyzing the Blind 75 and Grokking the Coding Interview, two other well-regarded DS&A interview prep resources.
Finally, while interviewing at Uber, I noticed a noteworthy pattern that had been left out of Prashad’s 22, which is the Divide and Conquer technique. This brings my final recommended total to 23. I repeat the learning steps below with recommended timelines for learning each:
Learn the Top 5 Patterns in 1-2 weeks.
Learn the 7 Key Patterns from Blind 75 in another 1-2 weeks.
Learn the above skills to the medium level in another 1-2 weeks.
Expand known patterns to the 14 Patterns in another 2-4 weeks.
Expand known patterns to the 23 Patterns in another 4-6 weeks.
Only at this point would I consider practicing hard questions.
Let’s consider the Top 5 and Top 7 Patterns to be basic patterns. Once you are comfortable at the medium level with these questions, it might be useful to try these two studying techniques as you continue to learn:
In general, try to complete 1-3 easy questions, 1 medium, or 1 hard each day, but make sure to take sufficient rest days! Please do not go weeks on end without break, it will likely be counterproductive.
How long should you study before interviewing? I think interviews themselves are excellent practice, and I hesitate to require too much studying in a blocking way before beginning interviews. Mastering the 23 patterns at the hard level frankly doesn’t seem necessary even for me at the Senior/Principal level, and it’s a thing that can take years to achieve.
Let’s exclude the 3 low-value topics from the 14 Patterns and call the remainder the 11 Patterns. Whatever problem you are given, let’s target solving the problem in 20 minutes. With that context in mind, here are some of my recommendations by job level:
Entry/Junior Level: Feel confident solving an easy from the Top 7 Patterns in 20 minutes.
SWE II to III: