Some background: I’ve interviewed hundreds of candidates for software engineering jobs at Facebook and Microsoft. I’ve also failed several coding interviews myself when I wasn’t prepared. I originally started writing this as an answer to a Quora question about the roadmap for software engineering interviews. Eventually, the answer became so long that I thought it warranted a blog post of its own.
Let’s get this out of the way. People ask me a lot: what’s a reasonable timeframe to crack the coding interviews if you’re starting from scratch? (i.e., you haven’t interviewed in the past several years.)
I would say that three months is a reasonable timeframe. Yes, really, three months. And barring that, at the very least dedicate 4–6 weeks if you haven’t interviewed in a while. You can probably get away with less than that if you have interviewed in the last 12 months or so.
Now for the meat. Below are the five main sections that software engineering interviews at “Big Tech” companies like Facebook, Google, Microsoft, etc. will consist of:
Like any other long-term goal that requires consistent work (such as getting ready to run a marathon), following some kind of structure is crucial, as it will encourage you to stay on track on days that your motivation might be waning.
To help with that, I’ve created a 12-week preparation plan that you can follow to prepare for your next coding interview. If you follow the plan over these 12 weeks, you’ll cover all of the topics mentioned above in a structured way. Let’s get started.
Pick a programming language and then stick with it. I’m often asked: what if I know more than one? Would, for example, Python be better than Java?
The answer, of course, is that the best programming language for your coding interviews is the language that you’re most comfortable with. Most companies/interviewers don’t care as long as you can show proficiency in any one mainstream programming language.
In some of the worst cases, I’ve seen people deciding to “switch” to a different programming language in the middle of the interview. That’s a big turn-off and a waste of time. Don’t do that. Pick one early, and stick to it throughout.
Brush up on your chosen programming language. There are going to be a lot of things that you’ve forgotten when you have been coding for your day job even using your preferred language. I’ve seen people struggling to remember things like:
Once, I saw a candidate get confused and not be able to remember how to figure out if a number was positive or negative. I’m sure they knew it. They just had a brain freeze.
The time and mental energy that you spend on trying to recall the nuances of your chosen programming language would be much better spent on actually solving the problem and exhibiting your problem-solving skills. That’s what interviewers want to see.
Some companies, like Lyft and Salesforce, require you to solve problems on a laptop. You are expected to write complete programs that pass given test cases. In these cases, you might have to:
Of course, you could just Google those, but that would be time spent on trivial tasks that are necessary but don’t help you stand out.
Most other companies, including Amazon and Google among countless others, will require you to solve problems on a white board. This is a very different experience, requiring some different skills than coding in an IDE. Now is the time to start practicing actually writing out code (while talking through your thought process) to flex those muscles.
Start revising Computer Science concepts like Data Structures and Algorithms. You know, those concepts that you once studied in your undergrad and have never looked at since. They’re actually quite useful in coding interviews. Here are some relevant resources:
For Python, look at Data Structures for Coding Interviews in Python
For Java, look at Data Structures for Coding Interviews in Java
For C++, check out Data Structures for Coding Interviews in C++, as well as Algorithms for Coding Interviews in C++
For Algorithms in various Coding Languages, check out Algorithms and Complexity Analysis: An interview refresher
For Big O notation and complexity analysis, look at Big O for Coding Interviews and Beyond. You can also check out our article The insider’s guide to algorithm interview questions, which gives you a detailed look at complexity analysis and how to work with it.
Remember to revise topics like:
As you are familiarizing (or re-familiarizing) yourself with data structures, start practicing relatively simple coding problems associated with these data structures and algorithms.
These questions are typically not asked in interviews at big tech companies. Even if they are, they’re usually used as fizz-buzz type warm-up problems. Such questions are also common during phone interviews. However, practicing these coding interview questions will help you internalize the data structures and help you tackle the harder questions which you’ll be practicing a few weeks from now.
Brush up your array skills with questions like:
Brush up your Linked List concepts with questions like:
Brush up your Stack/Queue skills with questions like:
min()returns minimum value in
Practice Tree Problems like:
Practice Graph Problems:
Practice basic Trie Problems:
Practice basic Heap problems:
Now that you’ve been practicing more straightforward problems for a couple of weeks, it’s time to get real and start practicing harder questions that are more likely to be asked during coding interviews.
Here are some guidelines to keep in mind as you solve these problems:
Now is the time to start timing yourself. Ideally, you shouldn’t spend more than 20–30 minutes solving any given problem. This probably won’t be possible for all questions right away.
Don’t be discouraged if you are not able to solve a problem within the allocated time. Solve it even if takes you a couple of hours, without looking at the solution. This will help you build the confidence that you can solve it and then you can focus on solving them faster later.
Start thinking about the Runtime and Memory complexity of each solution. You will have to articulate the complexities in the actual interview clearly, so it’s better to start now.
Here are some sample problems to consider:
You will have to spend 2–3 weeks here. Don’t worry if you hit roadblocks and get stuck often — you will get the hang of it after a while. Trust me, questions that look impossible in the first few days start to seem easy after you’ve had practice.
For practice and automated challenges along with interactive solutions, look at Grokking the Coding Interview
System design interviews are now an integral part of the software engineering interview process, particularly if you are applying for a senior role. These interviews have a significant impact on your hiring level.
Learn distributed systems concepts like Cap Theorem, Consistency, Partitioning, Load-Balancing etc.
As part of your System Design Interviews, you are asked to design a “web-scale” service. Interviewers are interested in evaluating your ability to describe the different parts of a scale-able service, such as:
You’ll want to practice questions like:
Ccheck out my article Top 10 System Design Interview Questions more example questions, tips, and resources.
Today, even "budget” laptops and mobile phone have multiple cores. Understanding concepts like Threads, Locks, Synchronization, etc. are beneficial whether you are building a mobile app or a web-scale service.
Just like System Design interview questions, Multi-Threading and Concurrency Interview questions are useful in gauging your level. A junior engineer will struggle with these questions (and are expected to learn more on the job). A relatively senior engineer is supposed to do better in such questions as they would be responsible for writing a lot of code that takes advantage of multiple cores/threads.
C.H. Afzal’s Multithreading and Concurrency for Senior Engineering Interviews series is an important one to check out, and available in multiple programming languages.
Some common questions include:
In Object Oriented Design Questions, interviewers are looking for your understanding of Software Design Patterns and your ability to transform the requirements into comprehensible Classes. You spend most of your time explaining the various components, their interfaces and how different components interact with each other using the interfaces.
Take a look at Grokking the Object-Oriented Design Interview to learn more about questions that are typically asked during OOD interviews.
Or check out my article The Top 10 Object-Oriented Design Interview Questions for Developers to get started.
This is the one that many think won’t matter, although this is the interview that sometimes matters the most. For example, at Amazon, culture is deeply rooted in their hiring process, where a “Bar Raiser” (someone who lives and breathes Amazon culture) can have the final say over you getting hired.
The thinking for that is quite simple: if you have the right attitude, you can learn new skills so minor shortcomings in your coding or system design interviews can be overlooked. However, if a person seems to be dispassionate about the product or doesn’t look like a team player, they are probably worth hiring even if they are great hackers.
There’s also a famous book called The No Asshole Rule. Companies try not to hire people who can be toxic — the long-term cost of doing so can be enormous. Companies also don’t want to hire engineers who are not passionate about the product. Cultural fit interviews are there to weed out such people.
To prepare for behavioral and cultural interviews, I recommend the course Grokking the Behavioral Interview.
Some of the basic rules of Cultural fit interviews are:
Show interest in the product, and demonstrate an understanding of it. I once had a candidate who told me that Facebook sells cloud services like AWS (Storage/Compute). He had even used one of those. Now, Facebook did buy Parse and kept it alive for a while, but Cloud Infrastructure was never Facebook’s primary/core business.
Be ready to describe scenarios where you had a conflict with your teammates or managers and how you resolved it. Please don’t say that you never had a conflict if you’ve been working as a software engineer for a few years.
Talk about what you want to accomplish in the company.
Talk about some of your recent / most significant accomplishments as an engineer.
Talk about some particularly crazy/difficult bugs that you encountered.
Preparation for coding interviews takes a lot of time and effort, but if that helps you stand out and prove that you’re ready for a complex job, it’s worth it. I’ve found it helps to keep in mind the value of the end-goal throughout. In this case, the personal satisfaction and financial compensation of landing a big-ticket software job.
For your reference, here are a consolidated list of the resources for software-engineering interviews that I’ve mentioned throughout the post:
Join a community of 1.7 million readers. Enjoy a FREE, weekly newsletter rounding up Educative's most popular learning resources, coding tips, and career advice.