Picture this: You just had your first coding interview and you are confident you will pass to the next stage. You discussed different approaches, you found the optimal solution, you implemented it and described the Big O time complexity. And the verdict comes: You won’t pass to the next stage!

It happened to me before and it took me many failures to figure out what I was doing. It’s the way you write your code. Let’s see if you recognize mistakes you make on a daily basis:

  1. Bad variable and function names: If your map is called ‘mp’ and your returned result is called ‘arr’, you need to step it up!
  2. Not respecting a Coding Style. You don’t make use of enough spaces and tabs and your brackets are all over the place
  3. Your code is over-complicated, hard to follow. This is a sign that you jumped too quickly into coding without having a clear picture of how exactly it will work and how to divide it into smaller components. Things like putting everything in one function or just having too many obfuscated if statements that can be rewritten in a simpler and easy to follow way. This is the reason why interviewers ask you to walk through an example over your code.

Code Quality is the most important thing interviewers are looking for. Many times a non-optimal well written solution will pass but an optimal bad implementation will not.