Improving software interview skills

Improving software interview skills

Many of us have been severely impacted by the Coronavirus situation and many have lost our jobs [Ref 1Ref 2]. The tech industry hasn’t been spared as well. As we see a large exodus of people, it is time that we should using time for improving coding interview skills. This article is featured towards improving your performance during the 1 hour coding interview. Hopefully this will increase the chances of you clearing it.

The Setup: A typical coding interview can be divided into the following three phases:

  1. Resume Drill Down: In this phase, the interviewer will ask you about your previous experience and drill into one of the many projects that you have done in the past. Overall Time: 5–10 minutes
  2. Coding: In this phase, the interviewer will give you a coding problem to work on and expect you to write a functioning code. Overall Time: 35–45 minutes
  3. Question/Answering: In this phase, the interviewer will expect you to ask some questions around the company, technology stack, processes etc. This is usually optional. Overall Time: ~ 5minutes

Note: This is how I end up conducting interviews @ThoughtSpot. However, different organizations may end up following different processes. For this article, I will focus on the Coding phase of the interview primarily.

From the perspective of the coding phase, there are primarily four major sub-phases:

Understanding the problem: This is the starting phase where the interviewer will walk you through the problem statement and expect you to understand the problem and ask clarifying questions. Some of the good practices to follow here are:

Clarify assumptions before proceeding: In case you have certain doubts around the question, feel free to ask the interviewer questions before thinking about a solution. This shows your ability to communicate, think abstractly and plan the solution better.

Understand input/output format: Understanding the format of the input/output is an important thing to do esp. within the context of a coding interview. Some of the questions that you can ask include can the input have duplicates, how big the number of values will be in the input, what is the format of the output etc.

Designing the algorithm: Once you are able to understand the problem statement well enough, you should start thinking about the problem solving part of this. Primarily, this will consist of algorithm design. Some of the good practices here are:

Deciding the algorithm before coding: In order to not spend too much time in coding, thinking through whether the problem is requires a greedy approachdynamic programming problem, graph traversal etc. is of utmost important. Once you decide on a specific algorithm, discuss this with the interviewer to see if he/she agrees with your line of thinking. This is usually a very good way of a low-effort, high confidence way of ensuring that you do not go down the wrong path.

Think through the set of input/outputs: As you design the algorithm, it is important to marry the algorithm with the expected input and output. This will ensure that you are able to design the interface of algorithm correctly.

Work through examples: After you are confident of the interface, take 1–2 examples and dry the algorithm that you have in your mind through the algorithm to see if the algorithm gives the right output. This can be a low-fidelity, low-effort check and will ensure that you are able to think about the edge cases/boundary-conditions etc.

Think Aloud: While ideating through the problem ensure that you are able to think loud. This is absolutely critical to do well in a coding interview. This gives the interviewer very signals about how your approach to problem solving i.e. can you think systematically, exhaustively etc. In case you get stuck, thinking aloud helps in clarifying your own thinking as well.

Coding: In this phase you should primarily focus on the coding the algorithm that you have thought of in the least amount of code. Some of the good practices that you can use are as following:

Data Structure Design: Think through the data structures that you will need. It is good to explain to the interviewer why and what data structures that you want to pick. This shows your depth of understanding and understanding of computer science fundamentals.

Interface Design: The next thing to consider is to think about what are the functions that you will use. Clearly writing down the interfaces will help. You might want to use some standard libraries. Ensure that you check with the interviewer if you can make certain assumptions about those libraries so that you can avoid writing these.

Code for the happy path first: It is usually a good practice to solve one problem at a time. This is fundamentally how human mind works. Therefore, it is important to first reduce the complexity of the problem while writing the algorithm. Coding for the happy path will help you do that. Once that is done, you can start thinking about the edge conditions and code for those.

Code-Dry Run: Once you are done writing the code, dry-run the code and check for the edge conditions. A fresh look at the code will help you identify any problems that are present in your code so that you can correct the code before you finish off with the coding phase and ask the interviewer to start reviewing the code.

Testing: Once you are done with the coding the algorithm, doing the following can help in shaping the code for review:

Test Case Enumeration: It is important to look at the problem statement, assuming that your solution is a black-box and enumerate the test-cases. A critical part of software development is test-thinking. Focussing on the dimensions such as edge-cases, variations of input, time-complexity, space-complexity, testing third-party libraries etc. will help you enumerate tests.

Wrap-Up: Ensure that you can quickly dry-run the code through the test-cases and do not see any obvious shortcomings. Once this is done, you are good and can finish the coding part of the interview.

How can you get help: I also plan to provide free mock interviews. Here is a calendar that you can use to schedule mock interviews (preferably on weekends).

For more blogs follow us here.

Christian Werling

CRO @ Eye Security | Making the world a safer place | Fun + effective Sales

4y

Ravi Tandon thank you so much for sharing! You might think what the hell does a ThoughtSpot RD have to say about best practices for a coding interview?! I did quite a lot of coding around 25 years ago (basic, turbo pascal, assembler, C, C#, Java). What I would recommend for the coding part is visualization! Visualize your assumptions of the task (input, output). Draft/note your idea of the data flow/limitations as well. This well a) help communicate with your interviewer b) help yourself not forgetting anything and c) will demonstrate how you can share your thoughts with other parts of the team (once you start working). If you do not feel comfortable using a whiteboard, a blank sheet of paper will also do the job.

To view or add a comment, sign in

More articles by Ravi Tandon

  • The Buddha Mind And The Curse Of Comparison

    The Buddha Mind And The Curse Of Comparison

    “Comparison is the thief of joy.” – Theodore Roosevelt.

  • The Flywheel Of Effectiveness

    The Flywheel Of Effectiveness

    Motivation We live in the world of social networks, smartphone applications, and the ever-increasing set of…

    2 Comments
  • Common Fallacies To Avoid in Daily Life

    Common Fallacies To Avoid in Daily Life

    Motivation As we live our daily lives, we tend to make many decisions that are done by ruled by our subconscious mind…

    1 Comment
  • Demystifying Coding Interviews

    Demystifying Coding Interviews

    How to prepare for coding interviews and find your dream job? Introduction Preparing for coding interviews can be very…

    3 Comments

Insights from the community

Others also viewed

Explore topics