Interviewing
Coding interview mistakes
Coding immediately, going silent, and waiting for the optimal solution are the usual fails. Name the miss and recover.
Most no-hires are process failures, not missing a trick. You coded the wrong problem, went silent, or sat on a blank editor hunting for O(n). Recovery is a skill: name the miss, reset, and leave a correct path on the board.
Concept
Interviewers expect bugs. They watch how you handle them — the same loop as debugging at work.
Walking through the usual misses
| Mistake | Why it hurts | Recovery |
|---|---|---|
| Coding immediately | Wrong problem, missed constraints | Stop, clarify, restart approach |
| Silent struggle | No signal for interviewer | Narrate stuck points; accept a hint |
| Optimal-or-bust | Zero code at minute 40 | Ship brute force, then optimize |
| No tests | Subtle off-by-ones | Always dry-run; fix live |
| Ignoring edge cases | Empty input, duplicates, overflow | Keep an edge-case checklist |
| Messy code | Hard to debug under stress | Slow down naming; extract helpers |
| Giving up early | Soft no-hire | Reset with a smaller subproblem |
If you discover a bug at minute 40, stay calm: name the failure, patch, re-run the example.
If the problem is truly unfamiliar, fall back to the process: correct brute force → identify bottleneck → apply the nearest pattern → communicate residual risks. A clear partial is better than a clever wrong answer.
Keep an edge-case checklist you actually say: empty input, one element, duplicates, already sorted, overflow, "what if n is 1?" Write the examples before the function body so the dry-run has somewhere to land.
Pick the approach you can implement cleanly when two ideas have similar complexity. A finished two-pointer with names beats a half-typed segment tree you cannot debug.
Common mistakes about recovery
- Pretending you meant the bug. Name it. Then patch.
- Abandoning a working brute force to chase a rumor of
O(log n)with eight minutes left. - Cascading tilt. One rough round is survivable. Replaying it in the next intro is not.
Check yourself
- Minute 12, you realize you missed "the array is sorted." What do you do?
Stop, restate the constraint, discard or adapt the approach, and say the new complexity. Do not keep typing the unsorted solution.
- Why is a clear partial better than a clever wrong answer?
The packet can credit process, communication and a correct subset. A clever wrong answer looks like you cannot test.
Key takeaways
- Most fails are process: clarify, narrate, ship a correct slower path.
- Recover by naming the bug, patching and re-testing out loud.
- Keep an edge-case checklist and a brute-force fallback.
Further learning
Back to the map: coding interviews.
Related
Coding interviews
Patterns, problem-solving process and communication for algorithm interviews — plus how practical coding rounds differ.
The interview problem-solving process
Clarify, work examples, state a brute force, then optimize, code, test and analyze. Interviewers grade the path.
Communicating while you code
Narrate intent, not keystrokes. Use hints, pick one language, and recover from bugs out loud.