~/coding-interview/how-prepare-coding-interview.md

How to prepare for your next Coding Interview

// TL;DR

Study all solutions (brute force to optimal), practice on paper first, understand time/space complexity, and build a consistent daily practice habit.

How to prepare for your next Coding Interview

Here are some tips while preparing for your coding interviews.

1. Do study or read or practice all the possible solutions of a problem

Do not just study the optimal algorithm. Study the Brute force algorith too. This will give you better understanding of the optimal solution. And, what are the problems in brute force solution.

2. Never look to solution without solving question

With so many references and solutions available on internet, you tend to see solution first. This is very bad practice, and will block your mind. You will not be able to come up to a solution if a different problem comes to you. If you are looking at solution first, you are memorizing the solution which will harm in the long run. Rather try to come up to a solution by yourself. Don’t worry about the complexity. Your mind will do wonders in this way. You are allowing your brain to find solutions.

3. Do not write code on an IDE, rather on notepad or copy-pen

While writing code, dont take help on an IDE. They will help in syntax errors and running the code. In practical interview, In almost 90% cases you are expected to write code on paper or on board. Today, IDEs are so advanced that they complete the word and any library function you want to use. Its the tendency of developer to take help of these IDEs and you dont remember the syntax. Although, syntax errors are not considered bad. But, its advisable not to use an IDE.

4. Practice behavioral questions if your experience is more than 4-5 years

In big tech companies, these qeustions are often asked. And believe me, these questions are hard. If you didn’t do practice, you will not able to come up to a satisfactory answer. Some examples are:

  • What is your biggest achievement
  • Which complex problem you think was the most difficult
  • How do you handle peer conflict or manager conflict
  • What practices you follow during your work
  • How you encourage innovation in your team
  • What aspects you see while doing code review
  • Have you ever failed when you took some decision
  • How do you come up to a solution when given problem
  • What are the initiatives you have taken
  • Have you opposed your senior’s solutions

etc

5. Do not memorize solutions

Always try to solve question by ourselves. Although sometimes, you need to know the various ways to solve particular problems. But, you should not memorize the solutions. Expert interviewer will come to know about this, and you will be knocked out fast.

6. You should be able to speak about every single piece of your code

Interviewer likes people who knows about every bits and pieces of code. You should know about runtime and space complexities of your code. Big tech companies like to listen your thought process of solving the problem. A big silence is a negative point.

7. Give Mock interviews or Test your interview skills

As normally candidates have few companies to target. You should not go straight to those companies to give interview. Either give mock interviews to your friends, or there are some online services which provides mock interviews. Another way is to start giving interviews to another companies for which you are not inrerested. But, by giving interviews to those companies will boost your confidence, and you will come to know many mistakes of yours. You will come to know what kind of questions are being asked by people. Reading from book and going in market are totally different aspect.

8. Try to write a perfect Code

You should look at following:

  • A bug free code (asked to write a production ready code) You should take care of all corner test cases as well.
  • Use modular code
  • Use object oriented approach to different aspects
  • Give a tested code to interviewer

Most of the time, candidates write the code and without testing their code, they hand over it to interviewer. There is no hurry. Please test your code with few test inputs. Sometimes, interviewer points out a mistake. And, candidate in hurry just fixes something carelessly. Which might fail other cases. So be very careful.

9. Keep a simple resume and mention things you know

Once I saw a 5 page resume of a candidate. When asked about some things mentioned in resume. I came to know that these are the things that he studied while his school. Resumes are to mention about the practical things you know. Single page resume speaks out loud when written in a correct manner. Only mention things you know, and can be asked upon.

10. Pick up a language

Don’t bother about mastering about many languages. Just stick to one language in which you can write code in front of interviewer.

$ subscribe --weekly

One deep dive a week, in your inbox

System design, AI engineering, trading systems and interview prep. Tested code, real numbers. Free, and you can unsubscribe any time.

or read it on gyanbyte.substack.com

Share

Related Posts

What FAANG companies expect in their interview from candidates

What FAANG companies expect in their interview from candidates

Its every software engineer’s dream to work with the big FAANG companies…

Magical usage of Bitwise operators - Get optimized solutions for many arithmatic problems

Magical usage of Bitwise operators - Get optimized solutions for many arithmatic problems

Introduction I will list some of the interesting usage of bitwise operators…

How to nail your Coding Interview

How to nail your Coding Interview

Here are some tips while giving your coding interviews. 1. Never try to jump to…

Coding Interview - Useful Terms Cheatsheet

Coding Interview - Useful Terms Cheatsheet

Big-O notation In simpler terms, its kind of a unit to measure how efficient an…

List of Sorting Algorithms

List of Sorting Algorithms

This topic is one of the most common studied. When somebody started preparation…

Coding Interview Cheatsheet

Coding Interview Cheatsheet

Latest Posts

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

In the previous article I argued that AI is not killing software engineering…

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

A few months back I approved a PR that was almost entirely AI-generated. It…

How to Debug AI-Generated Code: Understand First, Fix Last

How to Debug AI-Generated Code: Understand First, Fix Last

In the last article I wrote about reviewing AI code before it goes in. This one…

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

Every few weeks somebody sends me a scary headline — “AI will replace all…

The Transactional Outbox Pattern: Never Lose an Event Again

The Transactional Outbox Pattern: Never Lose an Event Again

This is one of those patterns that looks like nothing until you get burnt once…

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Here is a question I like to ask in interviews: your bank account shows a…