By: Fahim Ul Haq, Ex-Facebook, Ex-Microsoft, Co-founder at Educative.io
(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.)
The 3-month Self-Study Roadmap to Success at Software Engineering Interviews
Interviewing soon? Click below to view Educative's library of interview prep courses so you can go in with confidence and land your dream job.
Three months — Really?
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:
Coding Interviews (focusing on problem-solving, data structures, and algorithms)
OS and Concurrency Concepts
System Design Interviews
Object-Oriented Design Interviews
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.
Week 0 — What Programming language should you use
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.
Week 1 — brush up on the basics of your favorite programming language
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:
How to read/write from/to files
How to read input from the console
How to split strings
Is string length a function or a property (answer: it doesn’t matter, but still reflects poorly on you)
How to declare and use 2D arrays
In C/C++, how to handle null-terminated strings
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:
Process command line arguments
Parse CSV or text files
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.
weeks 2 & 3 — Data structures and algorithms
Start reviewing Computer Science concepts like Data Structures and Algorithms. You know, those concepts that maybe you once studied in your undergrad and have never looked at since — they’re actually quite useful in coding interviews. Here is a really helpful course when it comes to prepping for data structures and algorithms:
Remember to review topics like:
Complexity Analysis (a.k.a BigO), Arrays, Stacks, Queues, Linked List, Trees, Tries, Graphs (BFS and DFS), Hash Tables, Heaps, Sorting, Searching
weeks 4 & 5 — practice simple data structures and algorithmic challenges
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:
Remove Even Integers from Array
Merge Two Sorted Arrays
First Non-Repeating Integer in an Array
Find Second Maximum Value in an Array
Brush up your Linked List concepts with questions like:
Find Length of Linked List
Search in Singly Linked List
Reverse a Linked List
Find Middle Value of Linked List
Brush up your Stack/Queue skills with questions like:
Sort values in Stack
Create Stack where min() returns minimum value in O(1)
Implement Two Stacks using one Array
Practice Tree Problems like:
Find minimum value in Binary Search Tree
Find Height of Binary Tree
Find kth maximum value in Binary Search Tree
Practice Graph Problems:
Implement Breadth First Search
Implement Depth First Search
Detect cycle in Graph
Practice basic Trie Problems:
Total number of words in Trie
Find all words stored in Trie
Practice basic Heap problems:
Find k smallest elements in a list
Find k largest elements in an array
weeks 6, 7, 8 — practice more complex coding interview 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.
For more practice and challenges along with interactive solutions, check out the link below:
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:
Implement Binary Search
Find the Intersection point of two linked lists
Reverse words in a sentence
Check if two binary trees are identical
Clone (deep copy) a directed graph
Find solutions to a Boggle game
Determine if there are any three integers in an array that sum equal to the given value.
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.
weeks 9 & 10 — System design interviews
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.
For more design interview practice check out:
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:
How are web-servers load-balanced?
How are databases shared?
How are large files stored?
How is the network set up for redundancy and maximum throughput?
You’ll want to practice questions like:
Design Facebook Newsfeed
week 11 — os and concurrency concepts
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.
For resources on multithreading and concurrency check out the work from C.H. Afzal, a veteran of Silicon Valley.
week 12 — Object-oriented design interviews
Some common questions include:
Design an ATM
Design an elevator
Design a Parking System
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.
To learn more about questions that are typically asked during OOD interviews, check out the link below.
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 not 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 learn more about questions that are typically asked during these interviews, and how best to navigate them, check out the link below.
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.com 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.
Prepping for a specific company?
Check out our insider guides and question-banks for some of the biggest companies in tech.