Before writing any code in a live-coding interview, what should you clarify first?
answer
- The prompt is vague on purpose
- Say it back before you type
- Shape, scale, boundaries, return value
- Turn open items into stated assumptions
- Write them in the corner first
basics
~20 sRestate the problem in one sentence, then confirm the input shape, its realistic size, the behaviour on empty or malformed input, and the exact return value. Three or four scoping questions prevent solving the wrong problem and show how you take on work.
solid answer
~40 sI restate the problem back in a single sentence first, so the interviewer can correct me while correcting me is still cheap. Then I ask a small number of scoping questions: what the input actually looks like, how large it can realistically get, what should happen on empty or malformed input, whether duplicates and ordering matter, and what exactly I should return. Anything they leave open I convert into a stated assumption and say it aloud rather than silently deciding it. Three or four questions is the right budget — enough to fix the scope, not so many that I am visibly stalling. Then I write the agreed assumptions in the corner of the board or as a comment at the top of the file, and move into planning.
go deeper
Have a fixed opening ready: say the problem back in one sentence, then ask about input shape, size, empty input and the exact return value. Rehearse it until it is automatic, because nerves otherwise push you straight into typing.
Be ready to explain which questions actually steer a solution and which are filler, and to convert anything the interviewer leaves open into an assumption you state aloud and write down before coding.
Show that you close the phase yourself rather than being steered out of it: a few high-value questions, remaining unknowns declared as assumptions, and a visible record of both before the first line of code.
Own the tradeoff between scoping and momentum. Too little clarification builds on guesses; too much burns the clock and reads as avoidance. Decide where the line sits for the problem in front of you, and say why you stopped asking when you did.
## The phase exists because the problem is deliberately underspecified Problems given in live technical rounds are almost always stated loosely on purpose. The prompt names a goal and leaves the input shape, the scale, the tie-breaking rule and the failure behaviour undefined. That vagueness is part of the exercise: an interviewer wants to see whether you close those gaps by asking, or by guessing silently and hoping. Guessing silently is the single most common way a candidate loses points in the first five minutes of a round, because everything built on the guess is now unverifiable — the interviewer cannot tell a deliberate assumption from a misunderstanding once code is on the board. ## What is actually being graded Most rubrics for this stage carry a line about problem comprehension or scoping that is separate from correctness. It rewards three observable things: that you restated the problem accurately, that your questions changed what you were going to build, and that you made your assumptions inspectable. Notice that none of those require you to be right. A candidate who says *I am going to assume the identifiers are unique; tell me if that is wrong* has scored the point even if the assumption is wrong, because the interviewer can now correct it in one sentence. ## Four families of question worth asking **Input shape.** What am I actually handed, and in what form? A list, a stream, a nested structure, something already sorted? Is it handed to me whole, or do I have to request it in pieces? **Scale.** How large can it realistically be — hundreds of entries, or millions? This is the question that decides whether an approach that re-scans the input is acceptable or disqualifying, and it is the question candidates most often skip. **Boundaries and malformed input.** What happens on empty input, on a single element, on duplicates, on entries that are missing a field? Ask which of these the interviewer wants handled in code versus merely acknowledged; that answer alone can save you ten minutes of defensive branches nobody wanted. **The contract.** What exactly comes back — the value, the index, a count, a new structure, or a mutation of the one I was given? Confirming the return shape is cheap and it is where silent mismatches hide. A question fails to earn its place when the answer cannot change what you write. *Should I use good variable names?* and *Do you want this to be efficient?* are filler; they cost time and read as nerves. ## The budget, and where it sits in the round In a 45-minute round, this phase should take roughly four minutes — long enough for a restatement and three or four questions, short enough that the interviewer never has to steer you into starting. If clarification is still running at minute eight you have overspent, and the recovery is to state your remaining open items as assumptions and move on rather than keep asking. ## Record the assumptions on the artifact in front of you Whiteboards and interview editors have no runner, no test harness and no autocomplete: the artifact remembers nothing you did not write on it. Use that. Put the confirmed assumptions in a corner of the board, or as three short comment lines at the top of the empty file, before the first line of real code. They serve as a contract you can point back to when the interviewer probes an edge case later — *I flagged malformed rows as out of scope here; want me to fold them in now?* — and they let a second interviewer reading the notes afterwards see that the scoping happened. ## Worked example A mid-level mobile candidate interviewing at a scale-up that recently raised a Series C is asked to merge two lists of activity records into a single feed for a profile screen. The blank editor has no run button. Instead of typing, the candidate says: *So I am combining two record lists into one ordered feed and returning the merged list — is that right?* Then: are both lists already ordered by timestamp; can the same record appear in both; roughly how many records does a heavy account accumulate; and what should happen when two records share a timestamp? The interviewer answers that both are ordered, that overlaps happen, that a heavy account holds a few thousand records, and that ties can break either way. Four questions, well under two minutes, and the shape of the solution is now decided. The candidate writes *sorted inputs / duplicates possible / ties arbitrary* on the board and starts planning. ## The failure it prevents The alternative is the pattern interviewers see constantly: silence, then typing within seconds of hearing the prompt. It looks decisive for about three minutes, and then the candidate hits an ambiguity, resolves it in their head without saying anything, and builds twenty lines on top of it. When the mismatch surfaces at minute thirty there is no time to rebuild, and the round ends with an interviewer who never saw how the candidate thinks — only that they were wrong.
- What separates a clarifying question worth asking from filler?A question earns its place if the answer would change what you write. Input size, ordering guarantees, duplicate handling and the return shape all steer the solution. Asking whether you should name variables well, or whether efficiency matters, changes nothing and reads as nerves. Two or three steering questions beat six polite ones.
- The interviewer answers 'assume whatever you like' — what do you do?Take the freedom, but spend it out loud. Pick the assumption that keeps the problem interesting rather than the one that makes it trivial, say which you picked and why, and write it where you can both see it. Silence after that answer wastes the point; a stated choice still demonstrates scoping judgment.
- How do you keep the clarifying phase from eating the round?Cap it at a few minutes and a handful of questions. Ask the ones that change the approach first, so if you are cut short you already have what you need. When you notice you are still asking after several minutes, close the phase yourself: state the remaining unknowns as assumptions, write them down, and start planning.
saying these in an interview costs you the question
- Typing within seconds of the prompt, in silence, with no restatement
- Resolving an ambiguity in your head and never voicing the choice
- Asking filler questions whose answers cannot change the code
- Never asking how large the input can realistically get
- Asking a clarifying question, then ignoring the answer while coding