Preparing for Coding Interviews

Get your dream job

Ravi's Poetry
13 min readApr 25, 2020

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 and articles from the web to help those preparing for interviews.

Outline of the article: We have broken down the blog into the different sections that will try and answer the following questions:

  1. How are coding interviews designed ?
  2. What areas to prepare for a coding interview ?
  3. What are some of the best references and materials that could be used ?
  4. What is a good execution plan for a coding interview ?
  5. How should we strategize for a coding interview ?
  6. What are some of the companies that provide problems / coding interviews ?

How are coding interviews designed

The interview process is designed to assess a candidate on the following skills:

  1. Interview Phone Screen: Usually, the first round is a coding phone screen round where the interviewer would gauge your coding skills through a very small coding question. This is done over a phone and can be around 30–40 minutes long. The skillsets required for this are similar to ones required for a Coding Round.
    Eg. An example problem could be reversing a linked list
  2. Resume Drill Down: The resume drill down round is designed to understand your depth of understanding on 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 ?
  3. 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
  4. 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.
  5. General Problem Solving: This is usually an optional round and is used to test for the analytical problem solving skills in the candidate. This round does not involve much programming. It will be 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.
  6. Cultural Fit Round: Different organizations are built with very different cultures. This round is specifically focussed on testing whether the requirement of the organization meets the profile of the candidate. Some of the characteristics that are evaluated include 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:

  1. Data Structures: One of the most important aspects of the 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.
  2. 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.
  3. System Design: System design is an important part of a software engineer’s skillset. 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 industry using the StackShare website. Some of the common questions that are asked in the design round of companies are as following:
    a) Design the Search for a Social Network
    b) Design a Web Crawler
    c) Design a URL Shortener
    There are some really good design solutions outlined in this project.
  4. Computer Science Fundamentals: Understanding 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 following:
    4.a) Object Oriented Programming: Inheritance, Polymorphism, Encapsulation and Abstraction.
    4.b) Operating Systems: Thread, Process, Virtual Memory, Synchronization and File System.
    4.c) Networking: Protocols (TCP/IP) and Sockets.
  5. 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. 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.

References and Materials for Interview Preparation

Some of the projects that you can reference to and use during the course of your preparation are as following:

  1. 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.
  2. LeetCode: LeetCode is a great resource of 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 these set of problems, it could take you from anywhere 1.5 to 3 months depending on your level of comfort with programming problems.
  3. 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.
  4. 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 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) Cracking the coding interview
    4.b) Algorithm Design: Jon Kleinberg, Eva Tardos
    4.c) Introduction to Algorithms: Thomas H. Cormen
  5. University Courses: Lastly, but not the least 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 following:
    5.a) Data Structures: UC-Berkeley
    5.b) Introduction To Algorithms: Stanford
MOOCs are a great source of useful courses readily available online.
HackerRank has great content on learning software engineering.
CS Dojo has great content on how to solve coding problems.

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:

  1. 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:
    → 3 weeks working on the basics of computer science
    → 6 weeks working on programming problems
    → 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.
  2. 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.[Refer to Image: 2] 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 STLs (List, Queue, HashTable etc.).
  3. Brush up your 101 concepts: In the first 3 weeks try and cover/revise most of the basic concepts of the Computer Science. This will help you get setup 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.
  4. 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.
  5. 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.
  6. Reach-out to your Network for interviews: Last, but not the least start reaching out to friends, alumni, recruiters, professional networks (such as LinkedIn), recruitment platforms (such as Hired) etc. to schedule interviews.
Pick a language you know well. Source: https://airbrake.io/blog/comics/best-programming-xkcd-comics

Strategy

  1. 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 the 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.
  2. Mistakes to avoid: Some of the common mistakes that we make while preparing for interviews are as following:
    2.a) Do not jump into the hard problems up-front.
    2.b) Assume that you will start to solve problems from day-1.
    2.c) Think of writing code is the only necessary skill.
    2.d) Leave everything else in life to focus on interview preparation.
    2.e) Believe that algorithmic thinking is an innate skill.
  3. Set aside a time-table: Ensure that you have a specific time in your daily schedule for coding practice. An hour everyday 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.
  4. 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 (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 (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.

Enjoy the journey. Source: https://www.pexels.com/@abhishekgaurav

What should you know about interviews

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.

  1. Different companies have very different expectations from interviews. Even a given company will look for different characteristics in candidates at different period 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 a round that checks for company specific qualities in the candidate. Refer to Image 2 for the definition of “Bar” that different companies have. This is something useful to keep in the back of your mind while interviewing.
  2. Impact of having already seen the question is high. From a study that the 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%. (Refer to Image 3).
  3. Approach over 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.

Note: The learnings have been derived from over 1000 interviews.

Image: 2. Source: https://bit.ly/2yEl4au
Image: 3. Source: https://bit.ly/2yEl4au

Companies that provide coding interviews

There are some companies that also provide sample interviews to you so that you can get calls from companies.

  1. TripleByte: TripleByte lets you take an interview on their platform and then matches the candidates based on their performance to onsite round of different companies. This reduces the overall number of interviews you have to take as a candidate.
  2. 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.

References

Some of the references that I used for writing this article are outlined below:

  1. Top Data Structures you should know
  2. How I got into Google
  3. Tech Interview Handbook
  4. Coding Interview For Dummies
  5. GeeksForGeeks
  6. Common Coding Patterns
  7. Learning from 1000+ interviews
  8. 3 Month Long Interview Bootcamp

Writer’s Bio:
The writer, Ravi Tandon, is a software architect with ThoughtSpot and has over 6 years of industry experience building large scale systems. He has worked at startups in Bangalore (Flipkart, ThoughtSpot) and Silicon Valley (ThoughtSpot) . He graduated from IIT-Guwahati in 2012 from the Computer Science Department. He then completed his Masters in Computer Science from Princeton University, United States.

About ParShiksha:
This article is written in conjunction with a recent initiative that I have been working on called ParShiksha. ParShiksha is a small step towards the holy grail of providing “Education to Everyone”. We wish to use modern/state-of-the-art technologies, learning methodologies and social-awakening of the masses. If you like our work do follow-us @ WebSite, LinkedIn, YouTube, Facebook, Instagram.

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.

--

--