Here is a list, in chronological order:
1. Not asking clarifying questions
Asking clarifying questions is expected in interviews nowadays. It is common interview protocol that even companies talk about.
It saves you from trouble later on. For example, let’s say you assume that the input array has only positive integers. You write a solution that only works for positive numbers. But the interviewer was expecting it to work for negative numbers too.
“Shouldn’t the interviewer have clarified that before?”, you say.
Not really, it is part of the interview protocol mentioned above. You should know to ask these questions – it’s something companies want to test.
Examples of questions:
“Can there be negative numbers in the input array?”
“Is the graph directed or undirected?”
“Can the graph have cycles?”
.. and so on.
2. Coding without planning
If you don’t plan your approach, you will most likely get stuck at some point. Getting stuck is fine, but you don’t want to realize later on that you wasted valuable time coding something that doesn’t solve the problem.
So make sure you plan your algorithm before you start coding. Discuss it with the interviewer. The interviewer will not mind. In fact, they expect it nowadays.
3. Freaking out if you get stuck
Getting stuck is normal. Stay calm and don’t freak out.
To deal with getting stuck, read my answer here: What should I do if I get stuck in a whiteboard coding interview?
4. Not testing your solution after coding
After coding, make sure you test a good set of test cases. Just testing a sample input doesn’t mean the code works.
You want to demonstrate your testing skills and show that you write reliable code. Simply saying “it works” is a common mistake that candidates make, only to find that the interviewer caught an error in their code.
Having errors in code is fine, but make sure you verify/test the code and do your best at finding them yourself.
A common misconception is that knowing an efficient algorithm is enough. The fact is, you also need to follow a systematic process. It’s something many candidates take for granted, and it’s not as easy to “fake” as it might seem.
Our original answer on Quora