Demystifying Coding Interviews
How to prepare for coding interviews and find your dream job?
Introduction
Preparing for coding interviews can be very taxing and difficult for the candidates. Building the right strategy, putting in a lot of effort, and enjoying the overall journey are some of the key ingredients for anyone to be able to crack these. In this article, I wanted to share all my learnings from my own experiences to help those preparing for interviews.
Note: This is the second article in a series of articles, In-Preparation of Coding Interviews, that I am writing to help students prepare for coding interviews. The link to the first article in the series is here.
Outline
This article is broken down into 6 different sections that will try and answer the following questions:
- How are coding interviews designed?
- What areas to prepare for a coding interview?
- What are some of the best resources that could be used?
- What is a good execution plan for a coding interview?
- How should we strategize for a coding interview?
- What are some of the companies that provide mock coding interviews?
How are coding interviews designed?
The interview process is designed to assess a candidate on the following skills:
- Interview Phone Screen: Usually, the first round is a coding phone screen around where the interviewer would gauge your coding skills through a very small coding question. This is done over the phone and can be around 30–40 minutes long. The skillsets required for this are similar to those required for a Coding Round. Eg. An example problem could be reversing a linked list
- Resume Drill Down: The resume drill-down round is designed to understand your depth of understanding of the projects that you have already done in the past. The interviewer will try to get into a challenging problem that you have faced in one of the past projects and understand what your approach to solving it was. Eg. How were you able to scale the MySQL Database?
- Coding Round: Usually, there are 2 coding rounds each of 50 minutes each. In this round you will be given 1 (at max 2) problems to work on and will be expected to design an algorithm and write the code for it in a coding language. . The interviewer will judge on the skills of problem-solving, algorithmic thinking, and software engineering. Different companies have very different formats in which the interview is taken. Some companies may end up asking you to write the solution on a whiteboard; some may ask to write and run the code on an actual online compiler. Eg. Design an algorithm for the Knapsack Problem
- System Design Round: In the system design round the interviewer will expect you to design a system and possibly write pseudo-code for anyone part of the system. The interviewer will focus on any one particular area of the problem (eg. Performance, Scalability, User-Experience, etc.) keeping which in mind the system has to be designed. The skillsets that are measured during this process including problem formulation, system-level thinking, approach to problem-solving (systematic vs. non-systematic), communication skills, and architectural thinking. This interview is usually used to test when hiring software engineers at the level of an architect. Eg. Design a search engine.
- General Problem Solving: This is usually an optional round and is used to test for the analytical problem-solving skills of the candidate. This round does not involve much programming. It will involve solving a problem that can be a puzzle using the first-principles way of solving problems. Eg. Create a rand5() using a rand7() method.
- Cultural Fit Round: Different organizations are built with very different cultures. This round is specifically focused on testing whether the requirement of the organization meets the profile of the candidate. Some of the characteristics that are evaluated include the ability to take feedback, flexibility in thought process, broad-mindedness, ability to work in a team, flexibility in working hours, development methodology, etc.
Areas to prepare
In general, we can breakdown the preparation of the coding round into the following 4 areas of preparation:
- Data Structures: One of the most important aspects of coding interviews is the understanding of the basics of data structures. As someone who is preparing for coding interviews, it is important to revise CS-101 and ensure that the fundamentals are very well understood. Some of the most important data structures are Arrays, LinkedLists, Stacks, Queues, Trees, Graphs, Tries, and HashTables.
- Algorithms: Besides data-structures we are also expected to understand algorithms very well. Some of the most important concepts that everyone should know about algorithms are as following: Complexity Analysis, Recursion, Backtracking, Searching (Tree Search & Graph Search), Sorting, Traversal, Memoization, Divide and Conquer, Dynamic Programming and Finding Intervals.
- System Design: System design is an important part of a software engineer’s skill set. In order to prepare well for a system design round some of the concepts that the candidate needs to understand include Domain Name System (DNS), Content Delivery Network (CDN), Load Balancer, Reverse Proxy, Application layer, Database, Cache, Asynchronism, Communication. Besides, the concepts outlined here, you can learn from the design of systems from the industry using the StackShare website. Some of the common questions that are asked in the design round of companies are as follows: Design the Search for a Social Network, Design a Web Crawler, Design a URL Shortener. There are some really good design solutions outlined in this project.
- Computer Science Fundamentals: Understanding the fundamentals of computer science is necessary to be able to clear interviews. These concepts are useful in the design of complex systems and algorithms. Some of the concepts that are useful to know are as follows: Object-Oriented Programming: Inheritance, Polymorphism, Encapsulation, and Abstraction. Operating Systems: Thread, Process, Virtual Memory, Synchronization, and File System. Networking: Protocols (TCP/IP) and Sockets.
- Resume Understanding: It is good to have a grasp of the projects that you have done in the past. Revisiting the set of objectives of each project and the challenges you faced while building the project could be useful. The ability to explain the details of the project in a brief summary is helpful too. This requires good communication skills for you to be able to talk about the project. Being prepared upfront can certainly help out.
Resources for Interview Preparation
Some of the resources that you can reference to and use during the course of your preparation are as follows:
- MOOC Courses: Some of the websites such as Udemy, Coursera, MIT OpenCourseware provide really amazing set of courses that could be used for interview preparation. Two courses that I would recommend are Data Structure and Algorithm Analysis: To understand how to implement data structures from scratch. Software Engineering Interview Unleashed: Understanding the complete interview process for Google with some live sessions.
- LeetCode: LeetCode is a great resource for programming problems. They have a collection of problems that have been asked in the coding interviews of companies like Amazon, Facebook, Google, etc. They have four major sections in which they divide the programming problems. These are Easy, Medium, Hard, and Company Specific Problems. In general, being able to do 100% of Easy and 75% of the Medium level questions will be sufficient for you to clear the coding rounds of the best companies. In order to complete this set of problems, it could take you from anywhere 1.5 to 3 months depending on your level of comfort with programming problems.
- YouTube Videos: Learning from video lectures can be a great asset. In order to classify them, I would break them into two major sections: 3.a) Programming Videos: Solving programming problems requires good fundamental knowledge and pattern recognition. In order to understand how to recognize patterns, one could watch how other programmers learn to solve these problems. Some of the channels on YouTube that I have found useful are Errichto, CS Dojo, Algorithms With Rachit. 3.b) Concept Learning Videos: Some of the YouTube channels are really good resources for learning. The ones I would recommend are GeeksForGeeks and HackerRank. Besides, you can also use videos from Interview.io to understand how the interviews are done.
- Books: Some concepts are really well detailed in books. Books provide an organization of concepts that other resources do not provide. Besides, the content is highly reliable, has a high level of detail, and can be very well trusted. The downside of books is that they can be very dense and may take a lot more time to read through. Some of the books can be very expensive as well. Some of the best books on algorithms are 4.a) Elements of Programming Interviews in Java 4.b) Cracking the coding interview, 4.c) Algorithm Design: Jon Kleinberg, Eva Tardos, 4.d) Introduction to Algorithms: Thomas H. Cormen
- University Courses: Some of us will enjoy going through the university-style courses. Some of these courses are taught by the best professors in the world, have great content, and are very well organized. These can also serve as great materials for going through basic concepts. Going through the slides is something I would recommend for all the candidates preparing for interviews. Two courses that I would recommend are as follows: Data Structures: UC-Berkeley, Introduction To Algorithms: Stanford.
- Blogs: There are many different useful blogs that are out there which can help you prepare for different types of coding rounds. Some of them are as follows:
- Low-level design by Prasad Gujar
- System Design Cheatsheet
- System Design Rounds By Zack
- System Design Primer By DonneMartin
Execution Plan
Coming up with a good execution plan for your preparation is going to be critical if you want to really succeed at preparing well for your interviews. Here is a 6 step process that you can follow in order to prepare well for your interviews:
- Time Breakup: The 3–6–2 rule for preparation. While there are many ways to prepare for your interviews in terms of managing and breaking up your time one guiding schedule would be to spend the following number of weeks on different aspects of the interview preparation: (i) 3 weeks working on the basics of computer science, (ii) 6 weeks working on programming problems, (iii) 2 weeks preparing for mocks (before the first interview). These guidelines assume that you are able to spend 15 hours per week on the preparation. This can be done assuming 1 hour every weekday and 5 hours for each weekend.
- Pick up a coding language: As you start on a preparation journey, pick a coding language that you are very comfortable in. This is quite critical to your preparation journey. As you code in a lot of the interviews, it will be critical for you to be comfortable in the language. The probability of succeeding in a coding interview goes up if you code in your preferred language. You should try and learn some of the basic constructs such as String and Array Manipulation, Reading/Writing from/to a file, Looping, Variable and Function Declaration, Common Data Structures (List, Queue, HashTable, etc.).
- Brush up your 101 concepts: In the first 3 weeks try and cover/revise most of the basic concepts of Computer Science. This will help you get set up for using the concepts to solve the coding and design problems. You can revisit the concepts that have been outlined in this article as a starter.
- Coding: In the next 6 weeks just focus on coding and design problems and solve as many problems as you can. During that period figure out the areas that you think are your weaknesses and those that you think are your strengths. This will help you revisit them later in order to prepare these concepts better for the future. You can make use of resources such as LeetCode to practice the problems. The more problems you are able to practice the better will be your ability to pick up patterns in the problems.
- Mock interviews: In the last 2 weeks before you have to start to interview it makes sense to start scheduling some mock interviews. You can do these through your friends or through companies such as Interviewing.io etc. These will help you get into the rhythm of giving interviews and also prepare you for the problems mentally.
- Reach-out to your Network for interviews: Last, but not least start reaching out to friends, alumni, recruiters, professional networks (such as LinkedIn), recruitment platforms (such as Hired), etc. to schedule interviews.
Strategy
- Consistency is key: Remain consistent, no matter what. As you start working through the problems there will be many days where you will not be able to make any progress and there will be days when you will breeze through the set of problems. In both situations, remain focussed and solve problems consistently. Eventually, you will start to enjoy the process of solving problems once you become very clear with the concepts and patterns of the problems.
- Mistakes to avoid: Some of the common mistakes that we make while preparing for interviews are as following: (i) Do not jump into the hard problems up-front. (ii) Assume that you will start to solve problems from day-1. (iii) Think of writing code is the only necessary skill. (iv) Leave everything else in life to focus on interview preparation.(v) Believe that algorithmic thinking is an innate skill.
- Set aside a time-table: Ensure that you have a specific time in your daily schedule for coding practice. An hour every day in the evening during the weekdays and 5 hours for each weekend can be one way to go about it. Imbibing discipline will help you focus on the preparation and also ensure that you are able to make steady progress.
- Schedule interviews: This is something I found really useful when I was interviewing. I staggered my interview schedule over the course of 1 month. Here is how I bucketed companies: (4.a) Easy + Don’t care: These were the set of companies that I didn’t want to go to but still scheduled interviews. This helped me get practice interviews, learn about companies and also get the nervousness of interviews out. (4.b) Medium + Maybe want to go: These were the set of companies that I might want to go to (given the offer is good enough). These helped me prepare for the harder questions during the interviews. (4.c) Hard +Want to go: These were the companies that I certainly wanted to go to (eg. Google). Working here was my dream.
My own journey: I started by scheduling interviews in the bucket (4.a). This helped me get good interview practice. I then graduated from (4.a) to (4.b) and started to get more comfortable talking on the phone and sitting in front of a screen solving problems. Besides, I started to notice patterns in the questions and was able to easily solve problems by the mid of my (4.b) interview phase. Once, I entered my (4.c) phase, I started to get offers and eventually finished earlier. Phew !!
Talk to candidates who have recently interviewed in those companies lately.
You will start to enjoy the process of solving problems once you become very clear with the concepts and patterns of the problems. Love the journey, don’t worry about the destination.
Points to know (during an interview)
There are some points to keep at the back of your mind when you are going through the process of interviews. These observations are derived from this blog.
- Different companies have very different expectations from interviews. Even a given company will look for different characteristics in candidates at different periods of its journey. Companies tend to hire candidates based on their culture. In order to describe this companies usually keep one of the interview rounds as a “Bar Raiser”. A bar raiser is around that checks for company-specific qualities in the candidate. Refer to the image below for the definition of “Bar” that different companies have. This is something useful to keep in the back of your mind while interviewing.
- Impact of having already seen the question is high. From a study that Aline Lerner did at Interviewing.io, it is very clear that candidates who had seen the problem before had a higher chance of clearing the interview. The probability of clearing the interview went up by 16.6%
- Approach over the solution: While it is important to focus on the solution of the problem, qualitatively, it is important to have the right approach to problem-solving. Interviewers look for your methodology of thinking and gauge you on it. Some of the characteristics of good problem solvers are systematic approach, breaking the problem into smaller sub-problems, clarifying the assumptions up-front, working through the details of the problem, communicating with the interviewer well, etc. Focussing on these and demonstrating these during the course of the interview will hold you in good waters even if you are not able to fully solve the problem.
Companies that provide coding interviews
There are some companies that also provide sample interviews to you so that you can get calls from companies.
- TripleByte: TripleByte lets you take an interview on their platform and then matches the candidates based on their performance to the onsite round of different companies. This reduces the overall number of interviews you have to take as a candidate.
- Interviewing.io: At interviewing.io you can schedule mock interviews. These interviews are done with actual software engineers from companies such as Google and Facebook. Thereafter, you can take an actual, anonymous interview on the platform and get a call from the companies.
Thank you for patiently reading through this article.
If you found this useful, click the clap hands icon below which would make it easier for others to find this article and make use of it. Feel free to put your suggestions/comments in the sections below.
------------------------------------------------------------------------------------------------------------
Ravi Tandon is a Staff Software Engineer at ThoughtSpot where he works on Search. ThoughtSpot is a pioneer in search-driven analytics, and a leader in Gartner’s Magic Quadrant for Business Intelligence.
------------------------------------------------------------------------------------------------------------
References
Some of the references that I used for writing this article are outlined below:
- Top Data Structures you should know
- How I got into Google
- Tech Interview Handbook
- Coding Interview For Dummies
- GeeksForGeeks
- Common Coding Patterns
- Learning from 1000+ interviews
- 3 Month Long Interview Bootcamp
- Low-level design by Prasad Gujar
- System Design Cheatsheet
- System Design Rounds By Zack
- System Design Primer By DonneMartin
Lead Engineer @ Careem | Machine Learning & AI Platforms
4yVery informative. Thank you.
Product Manager at Aggio
4yThis post of yours is indeed insightful Ravi Tandon . Advice which needs to get out there to ease the job search struggle faced by many. Very well documented and explained with a lot of precision. Great effort. Thank you for this!
Head of Product Apple Applied AI | x-VP/GM/Director at IBM Watson and Unicorn Startups | Consumer & Enterprise Applied AI
4yGood advice Ravi Tandon! Thanks for doing this.