How to Conquer The Coding Interview

What interviewers look for

On the technical side, there are a couple of things interviewers look for:

  1. Problem-solving skills
  2. Bug-free coding abilities

For non-technical qualities, there are things like communication, culture, or even "leadership principles" (looking at you, Amazon), but those things are much easier to prepare. You don't need two months to learn how to say nice things to an interviewer, but you probably need that much time to learn to solve coding problems.

Problem-solving skills essentially mean how you reason a problem. Even if you encounter a previously unknown problem, you should be able to infer from known problems systematically. In his classic book "How to solve it", mathematician George Pólya offers many good tips: "look for a pattern", "draw a picture", "solve a simpler problem". We will use some of these techniques in AlgoMonster's articles.

Bug-free coding is self-explanatory. Unlike the tricky math problems you get asked during interviews, you'll be implementing solutions after discussion with your colleagues most of the days. Your actual bug-free coding-to-specifications ability is essential. This is not hard to prepare. You have to practice A LOT.

The System

At AlgoMonster, we love systems. We are big believers in systems over goals.

Throughout this website, you'll see systems for solving common interview patterns, such as the three-step system for backtracking. For mastering coding interviews in general, we have summarized a three-step system:

  1. Understand how basic data structures work like the back of your hand
  2. Mastering common patterns through practice
  3. Working through many problems and deriving mental solutions

1. Understand basic data structures

This means basic stuff like an array, stack, or linked list. Stuff you'd use in daily programming. If you have any real-life coding experience, you should know these already. Although depending on your understanding, you may have to brush up on how things work behind the scene. We have language-specific data structure overviews to get you started.

2. Mastering common patterns

There are literally thousands of problems out there on the internet you can practice, which can be overwhelming. The good news is that there are only a handful of common patterns you need to know. Once you master the patterns, you'll be able to apply the techniques to solve other problems. The key is to understand the common patterns well and be able to code them bug-free. For each pattern and its example problems, we have inline editors and test cases for you to practice what you've learned right away. Do this as many times until you can code them bug-free quickly.

Why mastering the pattern is important

Because we don't know what we don't know, humans can only infer from what we know. If a problem requires prior knowledge and we don't have that knowledge, then it's essentially intractable. This is especially true in a coding interview with limited time. When the pressure comes, we don't usually rise to the occasion. Instead, we fall to our highest preparation.

Can't I figure out these patterns myself?

You totally can. It takes time and experience to do many problems and figure out patterns. To quote Issac Newton, "if I have seen further, it is by standing on the shoulders of Giants." We've done the leg work for you. And we are constantly updating the content to stay up to date with current interview trends.

3. Work through many problems and derive mental solutions

The third step might seem odd at first glance. Shouldn't you code every problem you see? In theory, yes. But we only have so much time in a day. We have our jobs, school work, or even kids to take care of. We don't have time to code every problem out there. And that's OK. After we have mastered step 2, we should be able to look at a problem, identify which pattern it belongs to, and derive a mental solution. By going through as many problems as possible, you save much time and greatly expand your knowledge. This makes it easy for you to figure out the problem type during an actual interview quickly.

To help you with that, we have a Speedrun feature. Instead of coding each problem, you will be given a multiple choice question related to the techniques and templates used to solve the problem. This cuts down the time to go through many problems significantly.

In summary, in Step 1, you can learn in an intro to online programming course. Step 2 is what AlgoMonster is designed for. Step 3 you can achieve using the Speedrun feature or going to websites like Leetcode or Hackerrank.

Doing coding interviews is no easy task. But with a sound system in place, all you need is the practice to conquer the coding interview.

Some notes before we move on to the next section:

  • The problems on the website do not always have all the test cases. The goal of the platform is to help you learn the patterns and techniques as quickly as possible, not to be exhaustive in test cases. In a real on-site/virtual interview with an interviewer, you will be asked to write code on a whiteboard or a shared editor. And there are no existing test cases to run against your code as you'd do on LeetCode or Hackerrank. The interviewers will most likely ask you to write/think of a few test cases that cover the basics as well as some edge cases. In addition, explaining your thought process and how you came up with the solution is also important. So don't fret if you find a problem that doesn't have all the test cases. For majority of the people, the goal is to learn the techniques to pass the interviews as quickly as possible, not to become a competitive programmer.
  • Currently we don't have video content. We are working on it. But we have a lot of content already. So we hope you can get started with the written content first. We will add video content as we go. Be sure to subscribe to our Youtube Channel to get notified when we have new videos.

Still not clear? Submit the part you don't understand to our editors.