Many candidates who can solve a problem alone go quiet in a coding interview and type in silence. The interviewer then has to guess what they're thinking, and guessing rarely works in the candidate's favour. Most interviewers score communication and problem-solving alongside correctness, and the only evidence they have for the first two is what you say.
Talking while coding feels unnatural at first. It gets easier with a routine.
What the interviewer is trying to see
- Do you understand the problem before you start?
- Can you find a working approach, and do you know its trade-offs?
- Do you make sensible decisions as you code?
- Do you check your own work?
Silence hides all of that. A candidate who explains a decent solution clearly often scores better than one who silently writes a slightly better one.
Before you write any code
Restate the problem
Say the problem back in your own words, with a small example:
"So I'm given a list of meeting times as start and end pairs, and I need to return the minimum number of rooms so no two overlapping meetings share a room. For example, meetings at 9 to 10 and 9:30 to 11 would need two rooms."
This catches misunderstandings in the first minute, when they're cheap.
Ask about inputs and edge cases
"Can the list be empty?"
"Are the times already sorted?"
"If one meeting ends at 10 and another starts at 10, do they overlap?"
"Roughly how large can the input be?"
You don't need to ask everything. Two or three questions show you think about the boundaries.
Describe an approach before coding
Start with the simplest approach that works, even if it's slow, and say its cost:
"The straightforward way is to check every meeting against every other one, which is quadratic. A better way is to sort by start time and keep track of when the current rooms free up, using a min-heap of end times. That's n log n for the sort and the heap operations."
Then ask:
"Does that approach sound reasonable before I start writing it?"
Most interviewers will tell you if you're heading somewhere they don't want. That one question can save you twenty minutes.
While you code
Narrate decisions, not keystrokes. "Now I'm typing a for loop" adds nothing. Say why:
"I'll sort by start time first, because I want to handle meetings in the order they begin."
"I'm using a heap here because I only ever need the earliest end time."
"This check handles the case where a meeting starts exactly when another ends, which we said doesn't count as an overlap."
It's fine to go quiet for a few seconds while you write a line. Then summarise: "So that loop assigns each meeting to a free room or opens a new one."
If you write something you know is messy, say so: "I'll clean this up if there's time, but I want to get it working first." It shows judgement.
After you finish
Test out loud with a small example, tracing the values:
"Let me run the 9 to 10 and 9:30 to 11 example. After sorting, the first meeting goes in, heap has 10. The second starts at 9:30, which is before 10, so it needs a new room. Heap has 10 and 11. Answer is two, which is right."
Then check an edge case, such as the empty list, and state the final complexity. If you can see an improvement you didn't have time for, mention it.
When you need to think
Silence for a few seconds is fine. For longer, tell the interviewer what you're doing:
"Give me a moment to think about whether sorting by end time would be simpler."
If you get stuck, there's a separate routine in what to do when you get stuck in a coding interview.
Common habits that hurt
- Starting to code before confirming the problem.
- Long silences with no explanation.
- Narrating every keystroke instead of the reasons.
- Ignoring the interviewer's hints because you're focused on your own plan.
- Declaring "done" without testing.
How to practise talking while coding
Talking while coding is a separate skill from solving problems, so it needs separate practice:
- Solve practice problems out loud, alone, recording yourself. Listen back for long silences and unclear reasoning.
- Practise with a friend acting as interviewer. Ask them afterwards what they understood about your approach.
- Explain your solution to a non-programmer. If they can follow the outline, an interviewer certainly can.
For the explaining part, an AI mock interview set to a technical round lets you talk through your approach to a problem and get scored on how clear and complete the explanation was. For more on technical formats, see the technical interview practice page and the technical interview guide.
Your next step
Take one practice problem you've already solved, and solve it again out loud with a timer, following the routine: restate, ask, approach, code with reasons, test.