How to prepare for a coding interview at top tech companies?

Prepare for top tech company interviews with minimal outside help and uncover the secrets to success. Learn how to practice on platforms like Leetcode, understand the essence of each topic, and adapt them to different problems.

How to prepare for a coding interview at top tech companies?
Photo by Nangialai Stoman / Unsplash

# How to prepare for a coding interview at top tech companies?

TLDR

  • Preparing for a coding interview at top tech companies requires hard work and luck.
  • Focus on understanding the essence of each topic and how it can be applied in different scenarios.
  • Utilize the Blind 75 and Leetcode 170 lists to practice, and aim to solve 2 medium or 1 easy + 1 hard question within 45-60 minutes.
  • Review different approaches to solving a single question, and understand why certain patterns exist.

I won't provide generic answers like "Just do a lot of Leetcode" or "Follow the CTCI, Leetcode, and XXX plan". These types of recommendations are already widely available online. Instead, I'll share how I prepared for top tech company interviews with minimal outside help.

Quantity vs. Quality

It's no secret that hard work is necessary to become skilled at coding interviews. However, luck also plays a role in passing the interview. While practicing on platforms like Leetcode is necessary, after a certain point, the progress tends to plateau. You won't experience the same level of progress as you did when you first started practicing. Remember, there are an infinite number of questions available online, so don't focus on finishing them all. Instead, focus on capturing the essence of each topic and how it can be applied in different scenarios.

For example, when practicing BFS/DFS questions, pay attention to the loop conditions, how to extend them to advanced data structures, and different techniques for traversing a graph.

Here's a great post from Leetcode that covers a variety of topics: [insert link here].

Don't stress about having to solve 500, 700, or even 1000+ questions before an actual interview. What's more important is that you understand how each topic can be adapted to different situations.

The Right List

In my experience, I found the Blind 75 or Leetcode 170 lists to be incredibly helpful. These lists have been curated by a community that believes they cover over 80% of coding interview questions. The Blind 75 is a subset of Leetcode 170, so you can progress from 75 to 170 once you're comfortable.

Here are the links to these lists: [insert links here].

When working through these questions, I recommend grouping similar topics together to get a better feel for how each topic evolves and what to look for when solving related questions. Some suggest preparing for interviews by completing at least 10 questions on each of the topics covered in Leetcode.

Don't worry too much about questions that require a very specific solution, such as [sliding window median].

The Process

To simulate the actual interview process, it's important to follow a few guidelines while practicing on Leetcode:

  • Aim to solve 2 medium or 1 easy + 1 hard question within 45-60 minutes.
  • Avoid the usual "trial-and-error" process. Try to write bugless code in one or at most two attempts before submitting.
  • Write pseudocode and create functions, even if they seem unnecessary (e.g. validate_input, filter_invalid).
  • Think out loud and talk through your thought process as you progress. This can be challenging, but it's important.

To further prepare, pay attention to the tags assigned to each question on Leetcode. This will give you an idea of the topic and subtopics covered in each question.

Practicing in this way will help reduce stress during the actual interview. If the interview is the first time you try to write bugless code in one shot, it can be overwhelming and cause unnecessary stress.

Reviewing Answers

It's okay to not have a "feel" for a question after 5 minutes. Sometimes coding questions can be a case of "you know it or you don't." In these instances, reviewing the discussion section can be a great learning opportunity.

Take the time to review different approaches to solving a single question. (I strongly recommend having Leetcode premium.) If you can solve a question in multiple ways, it means you truly understand the problem. However, be careful not to fall into the trap of constantly switching between answers and coding. This can indicate a lack of understanding.

Spend time reviewing "related questions" as well. These questions may seem similar, but have subtle differences that can significantly affect the solution space. Understanding these differences is crucial for success in interviews. [Insert an example here]

Improving Your Skills

There are countless resources available online for preparing for coding interviews. I found the following resources to be particularly useful:

  • Leetcode discussion section and interview question section
  • Leetcode weekly contests

The discussion section can help you understand what a specific company might be looking for and provide real-world questions from interviews. Pretend these questions were asked of you and try solving them. It's a highly effective practice method.

The weekly contest is another great way to practice.

Avoid Brute Force

Don't fall into the trap of blindly applying templates or existing methods to solve every question. While they can be helpful for certain problems (e.g. LCS, binary search, substring), relying too heavily on these patterns can limit your approach to different questions.

Instead, try to understand why these patterns exist. For example, when and why should we use mid < left vs mid <= left in binary search questions? Don't assume that minimum or maximum values mean dynamic programming is the only solution. Understanding the underlying principles and adapting them to each problem is key.

Subscribe to Blog - Louis

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe