Sparround

The live coding process

What is judged in live coding is not the correct answer, it is the process. The interviewer wants to see how you work day to day, compressed into 40 minutes: how you clarify requirements, weigh risk, find mistakes and take feedback.

A repeatable seven-step process:

  • 1. Clarify the problem — input format, size limits, can there be duplicates, can the input be empty, what do I return (a value, an index, a boolean)
  • 2. State examples and edge cases — say the expected answer aloud for one normal example, then list the boundary cases. This step is scored surprisingly highly
  • 3. State the brute force and its complexity — "The simplest solution is two nested loops, O(n²). That's my baseline." This always anchors you to a working plan
  • 4. Propose the optimisation and WHY — "The repeated operation here is lookup; a hash map makes it O(1), so O(n) overall." An optimisation offered without a reason is half credit
  • 5. Write the code while narrating — briefly comment on what you're writing: "now I'll declare left, which will be the window's left boundary"
  • 6. Dry-run on an example — after writing, walk a small input through by hand. Finding your own bug before the interviewer does is a strong signal
  • 7. Discuss complexity and trade-offs — time, memory, the alternative solution, what would change under different constraints
StepRough time (45-min session)What is assessed
Clarifying questions2-4 minutesNot coding before checking requirements — the most important habit in real work
Examples and edge cases2-3 minutesA testing mindset; seeing boundary cases in advance
Brute force + complexity2-3 minutesAlways having a working plan; naming complexity correctly
Optimisation and justification3-5 minutesPattern recognition; answering "why"
Writing code (narrating)15-20 minutesCode cleanliness, naming, traceable thinking
Dry-run3-5 minutesFinding your own bug — one of the strongest signals
Complexity and trade-offs3-5 minutesEngineering maturity: a choice, not a single solution

What to do when you're stuck. It happens to every candidate and interviewers expect it — what is assessed is not the getting stuck, it's how you get out.

Four tactics:

  • Say your thinking out loud — "I'm torn between two approaches: sort plus two pointers, or a hash map. The hash map is O(n) but I need to keep the indices..." That gives the interviewer a chance to steer you
  • Shrink the problem — take a small concrete case (n = 3) and solve it by hand. The general rule usually falls out of the concrete example
  • Simplify the problem — "Let me first assume all numbers are positive, then add negatives." Solving the simplified case beats being fully stuck by a wide margin
  • Fall back to the brute force — if time is running out, write the working O(n²). A working simple solution beats an unfinished clever one — the most important rule in live coding, and one many candidates break

How to take a hint. A hint is not a sign of failure — the interviewer wants to move you forward, because what you do next is more interesting to them. The right reaction: stop, listen, thank them, and say out loud what it changes. "Right, so I should use the fact that it's sorted — then two pointers can come from opposite ends, because..." Ignoring a hint and pushing on with your own path is the worst reaction: it signals someone who doesn't take feedback on a team.

Silence is the worst failure mode. The interviewer cannot see inside your head — 60 seconds of silence looks to them like "knows nothing", even when you are in fact thinking in the right direction. If you need time, announce it: "Let me think for a minute, then I'll tell you my approach." That is completely normal and vastly better than silence.

Interview tip: open the session with one sentence — "If it's alright, let me ask a few questions and talk through my approach first, then start coding." That sentence does three things: it buys you thinking time, it shows you work in a structured way, and it agrees the process expectation. Conversely, the most common mistake is starting to type the instant you hear the problem. It doesn't read as speed; it reads as an engineer who doesn't check requirements.