Interviewers don't only grade the final code. They grade how you got there: did you pin down the problem, state a plan with its complexity, talk while you code, and catch your own bugs? Run the same four steps, out loud, every time. The two that candidates skip, clarify and test, are the two that lose the round.
A typical round is 45 minutes for one medium problem. Give each phase a slice and keep an eye on the clock. Click a phase to see what to do, what to say, and the red flags interviewers write down.
Interview prompts are vague on purpose. Pick the questions you would ask. Good ones fill in the spec and often change the algorithm, and weak ones burn time. Press Start planning when you think you know enough.
Pick the input types in your problem and tick the cases as you mention them. These same cases become your tests in step 4.
Say the obvious solution and its cost out loud, even when it's slow. It proves you understand the problem and gives you a baseline. Then look for what to remove. Click Next idea to climb the ladder.
Silence is the most common communication failure. Watch the same solution typed twice: once narrated, once silent, with what the interviewer is left wondering.
Each function below passes the given example and hides one bug. Pick test cases to dry-run, and try to catch it with as few runs as you can. Edge cases from step 2 are your best weapons. Every run shows the line-by-line trace, the way you'd do it on a whiteboard.
| Pick a test on the left. |
Interview moments: real situations from a round, each asking what you should do next. Then use the mock timer to rehearse a full problem out loud and score yourself on the four areas interviewers use.
Pick a problem you haven't seen, start the clock and talk out loud as if someone is listening. The checklist follows the phase you are in.
The four areas most big-tech coding rubrics use. Be honest, because the history is only for you. 1 = missing, 4 = strong.