Step by Step Guide for Coding Interview Preparation

Shubham Gautam
EnjoyAlgorithms
Published in
14 min readMay 21, 2021

Most developers need to realize the importance of data structure and algorithms as early as possible in their careers. The reason would be simple: knowledge of this subject helps us grow as better programmers and master computer science.

On another side, the interviewer uses DSA to test programmers during the coding interview. It provides them with a simple approach to evaluate problem-solving skills, basic computer science knowledge, clarity of thought, and analytical skills.

But mastering algorithms and data structure requires motivation, proper guidance, hard work, and a continuous learning plan. If someone wants to start an awesome journey, then answers to these questions are important:

  • How to develop a long-term interest in algorithms and data structure?
  • How to prepare a continuous learning plan to crack the coding interview?
  • What are the essential concepts and problem-solving approaches?
  • What are the critical activities which help us to learn quickly?
  • How to prepare for the coding interview in a limited duration?

Let’s dive deep and explore answers to these questions!

Step 1: Building a long term Motivation

A long-term vision is essential! We should think and explore: How are algorithms changing our lives? Why data structure and algorithms are crucial for career growth in tech industry? What are its real-life applications? Here are some critical ideas to keep close to heart:

  • For a programmer, data structure and algorithms is a 21st-century skill. Here every understood concept is like a gem, and nothing is like a failure!
  • We need to prepare for the ups and downs. It doesn’t matter if we fail while solving problems or understanding concepts. Even there is hidden learning in each error or bug.
  • Once we have a basic knowledge of data structure and algorithms, our interest in problem-solving increases more and more. Never giving up is the key!

Blog to explore: Why should we learn Data Structure and Algorithms?

why data structure and algorithms are important?

Step 2: Understanding data structure and algorithms syllabus for coding interview

After preparing the mind, now our first goal would be to prepare a list of essential topics important in data structure and algorithms. We can especially focus on the topics popular during the coding interview.

Algorithmic and Mathematical Thinking

Algorithmic puzzles, Brainteaser, Counting, Summation, Numbers theory, Permutation, Mathematical induction, Recurrence relations, Bit manipulation, Probability, etc.

Blogs to explore:

Fundamentals of Programming

Data Types, Variables, Operators, Expressions, Control statements, Loops, Functions, Pointer and Reference, Arrays, Strings, Memory Management, Fundamental of OOPS, etc.

Fundamentals of Algorithms

Linear Data Structures

Properties, Structure, Implementation, Basic operations, Patterns of iterative and recursive problem-solving and Real-life applications.

Blog to explore: Introduction to Data Structures

Non-linear Data Structures

Algorithm Design Techniques

Properties, Patterns of problem-solving and Real-life applications.

  • Dynamic Programming: Dynamic programming concept, Top-down vs Bottom-up approach, Type of DP Problems, Dynamic programming vs Divide and conquer, Bit-masking, Problem-solving patterns using a 1D array, Problem-solving patterns using a 2D array, Problem-solving patterns using a 3D array, etc.
  • Greedy Algorithms: Greedy choice property, patterns of Problem solving, etc.
  • Backtracking: Exhaustive Search, Recursive and Iterative Backtracking, Branch and Bound, etc.
  • String Algorithms: String matching, patterns of problem solving, various string algorithms, etc.
  • Mathematical Algorithms: Numbers theoretic algorithms, Bitwise algorithms, Randomised algorithms, etc.

Interview Preparation

  • Continuous practice of coding interview problems
  • Profile and Resume Building
  • Preparation via Mock Interview
  • Company-specific interview process research
  • Behavioral Interview Preparation

Step 3: Collecting One of the Best Resources for Learning and Practice

Our next goal is to collect helpful learning resources — books, blogs, talks, pdf, reports, courses, etc. Internet could be handy for this. We should follow the authentic sources and organize them according to the above syllabus.

You can explore the Self-paced DSA Course and DSA blogs by EnjoyAlgorithms. We have organized important concepts and questions in a guided order by following one of the best learning materials. If you want to learn live, you can explore our these two courses:

You can also try to explore some of these resources.

Data Structures and Algorithms for Beginners

  • Algorithms Unlocked by Thomas Coreman (MIT Press)
  • Algorithmic Puzzles by Anany and Maria Levitin
  • Mathematics for computer science by MIT Open Courseware

Data Structures and Algorithms for Advanced Learners

  • Algorithms by CLRS: Complexity analysis, Divide and Conquer, Sorting, Hash Table, Heap, BST, Graph, Dynamic Programming, Greedy Algorithms, Linear Data Structures, String Algorithms, etc.
  • The Algorithm Design Manual by Steven Skiena: Complexity analysis, Data Structures, Sorting and Searching, Graph, Backtracking, Dynamic Programming, etc.
  • Algorithms by Robert Sedgewick: Complexity analysis, Stack, Queue, Sorting, Priority Queue, Hash Table, Binary Search Tree, Graph, String Algorithms, etc.
  • Introduction to Algorithms by MIT Open Courseware.

For Advanced Programming Concepts

  • Programming Paradigms Course by Stanford
  • Programming Abstraction Course by Stanford
  • Programming Methodology Course by Stanford
  • Clean Code and Clean Architecture Book by Robert Martin

For Competitive Programming

  • Competitive Programming HandBook by Anti Laaksonen: Time complexity, Data Structures, Sorting, Backtracking, Greedy, Dynamic Programming, Range queries, Bit Manipulations, Graph Algorithms, Tree Algorithms
  • Project Euler
  • Codeforces

For Coding Interview Preparation

  • Cracking the Coding Interview by Gayle Laakmann McDowell.
  • Leetcode for the coding problems practice.

Step 4: Finding Good Mentor and Learning Communities

Our next goal should be to find a good mentor. A mentor can be a person who is good at problem-solving in data structure and algorithms.

A good mentor can help us in several ways:

  • Learning fundamentals concepts
  • Finding problem-solving patterns
  • Critical doubt handling
  • Coding interview preparation
  • Building a long term motivation

In addition to this, an excellent collaborative environment can also work as a catalyst. We should try to form a group of 2–3 people who have similar goals and schedule a weekly discussion. Working as a peer or observer for each other could help to bridge the gap of strengths and weaknesses in problem-solving.

If possible, we can also join some groups or online communities on social media to learn from the experiences of other programmers. It can also help in resolving DSA doubts and communicating ideas among the diversity of learners.

Step 5: Preparing a Continuous Learning Plan

We are assuming that any professional or student is ready to give an average of 15 hours/week. Here is a proposed benchmark of a time management plan that one can customize easily based on personal learning needs.

  • Total time on weekdays = 5 Hours (1 hours/weekday).
  • Total time on weekends = 10 Hours (5 hours/weekend).

Based on experience, let’s assume:

  • Solving one problem on paper with pseudo-code = 30 minutes (Average).
  • Solving one problem with well-written code = 1 hour (Average).
  • 1 Mock interview = 1 hour (Average).

4-Week Revision and Interview Preparation Plan

This is recommended for advanced learners who want to revise concepts and warm-up problem-solving skills for coding interview. Such learners should have a good understanding of data structure and algorithms, and programming concepts.

  • Estimated time = 15 x 4 = 60 hours.
  • Total coding problems to practise = 50.
  • Concept revision + Problem-solving Research = 20 hours
  • Problem-solving with well-written code = 10 hours (At-least 10 problems).
  • Problem-solving on paper = 20 hours (At-least 40 problems).
  • Behavioural interview preparation + Mock interviews = 10 hours.

8-Week Revision and Interview Preparation Plan

This is recommended for advanced learners who want to revise concepts and sharpen problem-solving skills for coding interview. Such learners should have basic problem-solving skills in data structure and algorithms and good knowledge of programming concepts.

  • Estimated time = 15 x 8 = 120 hours.
  • Total coding problems to practise = 100.
  • Concept Revision + Problem-solving Research = 30 hours.
  • Problem-solving with well-written code = 40 hours (At-least 40 problems).
  • Problem-solving on paper = 30 hours (At-least 60 problems).
  • Behavioural Interview Preparation + Mock Interviews = 20 hours.

16-Week Learning and Interview Preparation Plan

This is recommended for intermediate learners who want to learn advanced concepts and sharpen problem-solving skills for coding interview. Such learners should have a basic understanding of data structure and algorithms, and programming concepts.

  • Estimated time = 15 x 16 = 240 hours
  • Total coding problems to practise = 200.
  • Concept learning + Revision + Problem-solving research = 60 hours.
  • Problem-solving with well-written code = 80 Hours (At-least 80 problems).
  • Problem-solving on paper = 60 hours (At-least 120 problems).
  • Behavioural interview preparation + Mock interviews = 40 hours.

24-Week Learning and Interview Preparation Plan

This is recommended for beginners who want to learn fundamentals and sharpen problem-solving skills for coding interview. Such learners should have basic programming knowledge.

  • Estimated time = 15 x 24 = 360 hours.
  • Total coding problems to practise = 300.
  • Concept learning + Problem-solving research = 100 hours.
  • Problem-solving with well written code = 100 hours (At-least 100 problems).
  • Problem-solving on paper = 100 hours (At-least 200 problems).
  • Behavioural interview preparation + Mock interviews = 60 hours.

Step 6: Starting Continuous Learning Activities

Concept Learning/Revision

We should learn concepts in the proper order of dependencies and difficulties. If possible, try to prepare a self note and write down ideas in a well-designed textual and visual format. A good self note could help a lot in doing fast revision later.

We also advise planning a brainstorming session around each topic with your peer or colleague. If you find any DSA concepts difficult to understand, mark them, take help from a mentor. Continuously iterating and never giving up is an important rule to master DSA concepts.

Top 20 Data Structure and Algorithms concepts

Important Data Structure and Algorithms ideas

Problem-solving Research

Finding various patterns via coding problems is one of the best approaches to mastering problem-solving in algorithms and data structure. But the critical question is — what are the important problem-solving ideas to learn? What would be the best approach to solve a coding problem? Before starting problem-solving, we recommend doing an in-depth analysis of each problem-solving approach via 3–to 4 coding problems related to it.

Top 20 algorithms to learn Problem-solving

best algorithms to master problem solving in DSA

Top 10 problem-solving ideas to master for coding interview

Blog to explore: Popular problem-solving techniques in DSA.

Best problem solving ideas in DSA

Coding Practice and Problem Solving

To get better at solving problems, try solving problems on paper or on a whiteboard first. It can be a combination of visualizations, solution steps, and pseudo-codes. Writing down steps and necessary details can help us in designing efficient solutions.

After designing an efficient pseudo-code, our final aim would be to translate each line of pseudo-code into the correct code. Never forget to test code with various input-output data, edge cases, and all boundary conditions. Now once we are done with writing code in our programming language, take care of the following things:

  • Does this code provide the correct output for every set of inputs?
  • Can we optimize the code further? Always try to improve the code! If possible, look back, analyze it once again, and find a better solution.
  • How can we improve the readability of the code?

Blog to explore: Steps of problem-solving in data structures and algorithms.

steps to coding problem solving

Note: For coding practice, we recommend leetcode. One can find several coding problems organized according to the different difficulty levels.

Doubt Resolution

Whenever we start learning algorithms and data structure, doubts frequently occur, whether big or small. Sometimes critical doubts work as a roadblock to moving ahead in the journey. But our aim should be to take every doubt constructively and try to search for a correct answer. Even we should believe doubts as a natural part of learning which could take us to the next level of conceptual depth

The best idea would be: if there is a doubt, then first try to resolve it at the personal level. If we fail to get an answer in limited duration, then there can be several ways to get it fixed:

  • Discuss it with our peers or colleague
  • Get in touch with a personal or course mentor.
  • Post the doubts in the coding or learning community.
  • Ignore the doubts for a moment, note them down and revisit them later with a fresh approach. Sometimes doubts are related to the later part of the concept’s journey.

Behavioral Interview Preparation

If you are preparing for a dream job, then behavioral interviews are essential parts of the interviews. Most programmers underestimate this and do little or no preparation. One of the popular misconceptions is that behavioral interviews are less critical than technical interviews. But the truth is just the opposite: a behavioral interview is one of the vital factors if we want to stand out among several potential candidates.

Behavioral interviews help the interviewer to discover how you make decisions in critical situations and decide if you are someone they want to work with. So from the interviewer’s perspective, it is as essential as our coding interviews.

The idea of behavioral interviews differs from company to company depending on their values and culture. Here are some tips to prepare for the behavioral interviews:

  • Practice good nonverbal communication
  • Read the job description more than twice
  • Research the industry and company
  • Prepare for common questions
  • Make your sales pitch clear
  • Speak the correct body language
  • Have smart questions for the interviewers
  • Be positive, authentic, and truthful in your answers
  • Stay optimistic and prepare for the challenge

You should have at least one good example of:

  • An interesting technical problem you solved
  • An interpersonal conflict you overcame
  • Some unique execution story about a past project
  • Leadership or ownership
  • Question about the company’s product/business
  • Question about the company’s engineering strategy.

Mock Interviews

We must practice some mock interviews before attending an actual coding interview. The best idea would be to find a partner with similar career goals and simulate mock interviews with each other. At the end of the interview, both the interviewer and interviewees can exchange feedback for further improvement.

When we get feedback from another person, we can identify what we need to work on. Knowing where we need to improve is crucial for creating a practice plan for an actual coding interview. We can also record the mock interview session and use the footage to enhance body language for the actual interview.

Things to keep in mind during mock interviews

  • Ensure that the pairing partner has good basic knowledge and problem-solving skills in data structures and algorithms.
  • Use a timer to limit 45 minutes for the mock interview because most tech companies’ interviews last around 45–60 minutes.
  • Try to prepare your partner and ensure all checklists simulate it as an actual coding interview.
  • After the completion of the mock interview, now take the interviewer’s seat. It will help you understand what companies are looking for when evaluating a candidate.

Tips for learning DSA

  • Our goal must be to cover at least 80% syllabus and prioritize the topics based on their strength and weaknesses. A topic that requires more time should get more time
  • Doing a weekly critical review could help us to understand the progress. We should answer these questions — what is the further scope of improvement in the topic? What is the current level of our problem-solving ability? For the fact-based view, we recommend rating each topic on a scale of 1 to 10.
  • Few ideas always come during learning DSA: Brute force solution, efficient solution, boundary conditions, time and space complexity analysis, and coding style. Keep preparing notes if you find something unique or important patterns in these ideas
  • In the starting journey, rather than solving many problems, focus on the top 100 problems asked during the coding interview. The best idea would be to pick famous interview problems which can be solved using various techniques
  • Learn to visualize critical operations, implementations, and use case of each data structure
  • Never mind going through the same concepts and problems again and again. This would help in figuring out hidden ideas. Focus on reason and never try to memorize!

Tips for coding interview

We need to analyze the different coding interview scenarios and prepare a unique strategy. It would help in gaining confidence and a competitive advantage. Learn from the mistakes and keep improving! Here are some essential tips to keep in mind

  • After getting the problem, never waste time trying to think in your head. Get your thoughts down on paper, draw visualizations, write different test inputs, outline how you would get the given output by hand, write pseudocode steps, and think about translating it into code
  • Don’t put yourself in a hurry to design an optimal solution at the start. If possible, start with brute force or the most apparent correct answer and improve the solution further
  • Communication plays a vital role during a coding interview. Keep telling the interviewer how you are trying to approach the problem and discuss the most challenging part you face. Our aim should be to get all the relevant details and hints to reach an efficient solution
  • Make ensure that you are working as a team member to solve the problem. An interviewer is looking for a team player who can solve problems using good collaboration skills
  • Don’t get discouraged if you’ll get stuck. Even the interviewer is looking for your ability to think about the problem from various angles.
  • Think out loud and explain what you know about the solution idea. Explain what you thought might work and why it won’t work. An interviewer might give you a hint
  • Try to apply common problem-solving ideas or patterns. This could help you design efficient solutions quickly. Some problem-solving approaches come up, again and again, during problem-solving.
  • Stop looking for tips and tricks. This will not help in getting a dream job
  • Use descriptive variable names and a good coding style
  • Test solution for all the edge cases.

A final motivation!

A long-term vision, hard work, and consistency are the keys to mastering data structure and algorithms. Always remember this quote: “ If the mind is weak, then the situation becomes a problem; if the mind is balanced, then the situation becomes a challenge. But if the mind is strong, then the situation becomes an opportunity”.

Enjoy learning, Enjoy coding, Enjoy algorithms!

--

--

Shubham Gautam
EnjoyAlgorithms

Founder enjoyalgorithms.com | IIT | Super 30 | Educator | A learner who enjoys computer science, programming, algorithms, and problem-solving.