How to prepare for software engineer interviews at top tech companies
Who doesn’t like working for industry leading technology companies with a multi-hundred thousand dollar salary, and amazing perks(some even pay for your monthly groceries or food from restaurants)? But, there’s a barrier that you need to cross before you get there. It’s the long multi-round Interview barrier. I’m not gonna lie, it’s hard to pass and needs a lot of dedication, hard work and consistency but it’s nowhere near impossible. I was able to crack interviews with Uber, Facebook and Oracle. I’m a non-ivy college graduate without a computer science degree, if I can do it you can certainly do it!
This blog tries to cover the steps you need to follow along with a curated list of resources that helps you guide through the shortest path to the target. I’ll try to include few tips and tricks that I found very helpful and wish I’d done that early.
Generally the Interviews are split into three phases:
A) Recruiter Screening
B) Technical Phone Screening
A) Recruiter Screening: This is a casual phone conversation usually with the recruiter to give you some information about the company, team and position. They also ask about your background and requirements to make sure if they match the role. Although this is a casual conversation, recruiters do a high level assessment from things you speak, some even ask few technical questions which they have no idea about. They just cross check with the answers provided by their technical team. Duration will be about 30 mins.
They check if you are genuinely interested about their company and the position. Do your research about some facts and latest news about the company. They also want to know why you are looking for a new job. This is probably the most predictable interview. So, make some notes about these commonly asked questions and put it infront of you during this interview, since this is just be a phone interview the notes will come in handy. I use OneNote for my notes. Do this for every company you interview for.
Here is the sample notes I made for Uber:
B) Technical Phone Screening: This could either be an online coding challenge or a technical phone round or sometimes both. This can contain anywhere between 1 to 4 coding questions. For preparing this interview follow the Onsite Coding round preparation process described below. Duration of this round varies around 45 min — 1.5 hr
C) Onsite (Virtual onsite during COVID times): Once you clear the above two steps you’ll be forwarded to the final onsite rounds. Total duration could vary anywhere between 4–6 hours. These can be classified into 3 categories:
1. Coding round
2. System Design round
3. Behavioral round
Let’s dive deep into each one of these Onsite rounds:
Usually contains more than 1 round and you can expect more difficult questions than technical phone screening round. Duration of this round varies between 45 min — 1 hour.
This is the foundational and deciding factor for any Software engineer interviews. You’ll be given a question and some sample inputs and you need to come up with a logic that generates the desired output. Usually this could be a single method or class. You need to write syntactically correct code and no pseudo code please! Do your best to nail this round.
Tip: Practice writing code with pen and paper or in a word document, this will help you find where you are making mistakes and try not to make those mistakes next time.
Here is one of the popular questions — Two Sum
To solve such questions and clear this round there are a couple of things you need to prepare and practice. They are complexity analysis, data structures, algorithms, interview questions practice. Each one of this topic is explained below.
Complexity analysis(Big O notation):
Complexity analysis is important for any program you write. Many candidates will be able to solve the given problem but fail to give the most optimal solution. The performance of any two approaches can be compared using two attributes — time and space. The best algorithm should take least amount of time and space. This is represented by Big O. For example a linear time complexity is represented as O(n)
Tip: for every problem you practice, try to calculate time and space complexity then and there and write it in a line of comments. This helps you practice the calculation and eventually makes it feel simple.
- CTCI(6th Edition) — Chapter VI. This should be good enough for interview purposes
- Deep dive if you are interested — link
You need to have an idea on basic data structures and how to use them in your favorite programming language. Some of them are list/array, linkedlist, hashmap, stack, queue, tree, graph. It’s always good to know how these are implemented internally in the programming language of your choice.
While learning data structures focus on the best use cases for any data structure over others. For example if you have to maintain a relationship between any two datasets then hash map would be the best choice. Interviewers observe if you are choosing the right tool(data structure) for the given problem.
Also, observe the complexities for each operation in a data structure and try to understand how that’s calculated.
You can learn data structures from any computer science text books.
- Sorting algorithms: Sorting data is a fundamental operation, They turn disordered data into data ordered by some criteria. You can think of a sorting by price from low to high is any shopping website. There are many sorting algorithms, it’s good to know how each one of them functions internally. Few important sorting algorithms are quick and merge sorting
- Searching algorithms: Searching for some data is the most basic feature of any application. It is about retrieve information stored within some data structure. It’s important to know what are some search algorithms out there. The most basic one is Linear search and a really popular one is Binary search.
- Recursion: Recursion is a way of solving the large problem where the solution depends on solutions to smaller instances of the same problem. This will involve calling the the same method/function from itself. This might sound easy but is very mind twisting concept. You need to practice a lot to get a good grip on this. Knowing the base condition is probably the most important thing to know in recursion since that decides when you need to stop looping, otherwise it could go into an infinite loop. You need to make yourself very comfortable before jumping into dynamic programming. This is a good place to start learning about recursion — byte-by-byte recursion
- Tree and Graph algorithms: Trees and Graphs are the favorite data structures of the interviewers. You can expect at least one question in the onsite interview. Mostly you’ll be asked a question that involves Breadth First Search(BFS) or Depth First Search(DFS)
- Dynamic Programming(DP): DP is probably the most difficult concept of all. The best way to start would be this DP book from byte-by-byte. There are two approaches you can use for solving DP problems — Top-down and bottom-up. Some find one approach easier over the other but it’s crucial to excel in any one the approach and it’s good to understand how each one works. I like the way how he solves the problem by starting with a brute force solution using recursion and then introduces memoization to create a top-down solution and finally inverting the logic to create a bottom-up solution, it’s a really nice way to understand the difference between two approaches.
- Miscellaneous: There are few other popular algorithms that’ll help you find optimal solutions for certain problems — Greedy Algorithm, Floyd’s algorithm to detect cycle in a linked list, shortest path algorithms like Dijsktra’s and A* (A star).
Interview questions practice:
It’s very easy to come up with a theoretical solution to any interview question but it’s really difficult to covert that into bug-free code in 20 minute time frame. You need consistent practice to get there.
Tip: Every time you start solving any problem put a timer and keep shrinking the time as you practice more. A decent time frame is 15 minutes for Leetcode easy level, 20 mins for medium level and 25–30 minutes for hard level problems
If you check Leetcode there will be more than 1000 questions which may be overwhelming in the beginning but there will be a common pattern among them. It’s all about patterns! An amazing course that I found super helpful is educative.io — grokking the coding interview. This course is divided by such coding patterns and covers most of the questions. I found that it’s a really efficient way to practice with these patterns instead of randomly grinding Leetcode. Once you understand the internal mechanics of each pattern it’ll take no time to solve higher difficulty level questions of the same pattern.
Tip: Go through each pattern in educative.io and try to solve it there, if all test cases are passed then try to find the same question in leetcode and run your code there, leetcode contains hundreds of testcases and there is a high probability that your code could fail in few edge cases and then you can debug and fix the issue. This will help you write bug-free code.
Always look for better implementations than yours, even though you solved the question completely, make sure yours is the most clean and optimal solution. Interviewers don’t just need the answer, they look for clean code. Don’t initialize unwanted variables, define a separate method where necessary, do input validation in the first step before solving the problem.
Once you have a good feel with your coding practice start giving mock interviews. I failed in multiple interviews not because I don’t know the answer but just because of the interview nervousness. For every one of those interviews I was able to code up a solution after the interview but failed to perform in the interview. I highly recommend giving mock interviews from a few weeks before your interview cycle. This will help you get used to the interview process and better manage your time in the interview. Pramp is a great resource for that.
System Design Round:
Usually consists of 1 round but can have more depending on seniority of the position. Duration of this round varies between 45 min — 1 hour
System Design interview round evaluates candidates how well they can build production systems. Interviewer expects your system to be scalable, reliable, fault-tolerant, consistent and much more. Obviously no one can build and show a running production system in 1 hour interview so they are evaluated on a very high level architecture. This interview alone may not be a deciding factor(espeically for junior roles) but if you do well you can be considered for higher levels or bigger salary.
System Design question will be very vague and it’s intentional. A sample question would be “Design Facebook”. There are numerous features in Facebook that you can design for which you won’t have enough time. So, you need to first clarify requirements by asking questions on what the interviewer wants you to design. Eventually It’ll boil down to 2 or 3 features like being able to add friends and generating personal timeline etc.
There’s a lot of things you need to know to answer this question, most of which comes with hands-on experience. But there are good resources that’ll help you understand various layers in a system and popular tools to accomplish a certain task. This System Design Primer is a good place to start to learn about various components. Database, Cache, Load balancing, Asynchronism are a few popular topics.
Once you get a good grasp over the topics, start looking at a few examples. There are some examples in the above mentioned primer that you can start with. There’s also a great course in educative.io — grokking the system design interview which provides a framework on how to answer this question step by step. It’s really important that you clarify requirements, do capacity estimations and provide a very high level architecture before digging more deep in your design.
Generally for physical onsite interviews you’ll have whiteboard to draw your architecture but for virtual onsite interviews it’s a bit hard to convey your thoughts without a diagram, you can use online tools like google drawings or AWW app. It’ll be better if you familiarize yourself with any one of these tools
Again, practice is the key. System design interview don’t have a single solution, it’s highly driven by the interviewer. So it’s better if you practice with an interview buddy or use system design section of Pramp
- Educative.io — grokking the system design interview
- System Design Primer
- Tech Dummies YouTube channel — I love this guy’s System Design videos, he tries to provide as detailed information as he can
If you want to do mock interviews with some real Google/Facebook or other top tech company engineers here are few paid resources that you can use
This round is generally conducted by hiring manager or someone outside the team to make sure you have the core values that their company believes in and also to make sure if you fit in their culture.
Generally these rounds start by knowing each other and then asking a few questions about your latest project, your role and your contributions to that project. Later you’ll be asked a few situational questions that tend to be in this format — “Tell me about a time when”. For example they might ask you to “Tell about a time when you had a conflict with your manager and how you managed to resolve it?”
These are generally experiences from your professional day to day life. It’s not a good sign if you say that you never had that situation for multiple questions, you should atleast relate it to something that’s close enough to the question.
To answer such questions you shouldn’t just say about the issue but rather what the interview expects is a story on when/how/what happened in that incident and how you reacted/handled it and what were the outcomes(it doesn’t have to be always positive). STAR framework will come in handy here which basically says that you need to divide your story into what Situation this was happened, what you were Tasked with doing, what were your Actions and how were your Results.
In every such behavioural question interviewer expects a professional behavior from your answer. For example in our previous question you’ll be expected to behave professionally in case of conflict with your manager. You should collect enough data/metrics to strengthen your argument with your manager. In case of a confusion you should go with your managers decision. Interviewers looks for these points in your answer.
It’s not easy to remember something that relates to the question and frame it into a story on the spot. A good practice is to be prepared for some of the popular questions. Sit down and think about your past experiences for some questions and note them in an easily accessible place. The most important thing is that you are covering the expected/professional behaviour in your answer.
Behavioral interviewers assess candidates on competencies or core values of the company. For Example Amazon assesses candidates on 12 Leadership Principles. Every interviewer will be assigned one of these competencies and their questions will be around it. Ask your recruiter to share which interviewer is going to ask you questions about what competency. This helps you to be well informed and be prepared for it. Some recruiters share this information and some don’t, try your luck!
Tip: Buy premium membership of educative.io, leetcode premium and linkedin premium. Altogether It’ll cost you utmost $500 but it’ll make your life easy in your interview preparation. You’ll earn a lot more when you land on a job in one of the top tech companies.
- Read interview experiences in leetcode discuss, blind, glassdoor, especially for the ones which you are going to interview for.
- Do research on the company you are interviewing for and make a notes of some crucial information about the company like number of countries or cities it operates, number of users/customers, amount of data it handles, recent funding etc. This will come in handy when you tell about why you are interested in their company.
- Push your dream company interviews to the later part of the interview pipeline. Schedule interviews with some of your low to medium interest companies first. You won’t feel bad if you fail and you’ll get some practice before you attempt your target companies.
Remember that consistent practice is the key for cracking software engineer interviews. It’s hard but It’s worth the efforts.
Hope this is helpful and I wish you good luck with your job search!
Feel free to reach out to me on Linkedin if you have any questions.