How to Think Out Loud in a Coding Interview (With Scripts)
What to say at each stage of a coding interview — clarifying, planning, coding, debugging, testing — with example phrases and how to practise narrating.
"Think out loud" is the most common advice for coding interviews, and one of the hardest to follow. Under pressure, most people either go silent while they think or produce a stream of half-sentences that does not help the interviewer. Thinking out loud well is a skill: you share your reasoning in a way that lets the interviewer follow, evaluate and help you. This guide breaks it into stages, with phrases you can use and a way to practise.
Why it matters so much
The interviewer is assessing how you solve problems, not just whether you produce a correct answer. If you are silent for ten minutes and then write a perfect solution, they have little evidence of your reasoning, and they cannot tell whether you have seen the problem before. If you get stuck in silence, they cannot give you a useful hint. Clear narration turns the interview into a collaboration, which is closer to how engineers actually work.
Stage 1: Clarifying the problem
Restate the problem and ask questions. This shows care and catches misunderstandings early.
Useful phrases:
- "Let me restate the problem to make sure I understand: we need to return the length of the longest substring without repeating characters."
- "Can the input be empty? What should I return in that case?"
- "Are characters limited to lowercase English letters, or any Unicode?"
- "Roughly how large can the input be? That affects whether O(n²) is acceptable."
Stage 2: Working through an example
Say what you observe as you solve a small case by hand:
- "Let me try 'abcabcbb'. Starting at 'a', I get 'abc' before 'a' repeats."
- "When I hit the repeat, I don't need to restart from scratch; I can move the start past the earlier 'a'."
- "That suggests a sliding window."
Stage 3: Proposing approaches
Start with a simple approach and its complexity, then improve. Ask for agreement before coding.
Useful phrases:
- "The brute force is to check every substring, which is O(n³), or O(n²) with a set."
- "A better approach is a sliding window with a map from character to last index, which gives O(n) time."
- "Does that sound reasonable, or would you like me to start with the simpler version?"
Stage 4: Coding
You do not need to narrate every keystroke. Narrate decisions and intent.
Useful phrases:
When you need a few seconds of quiet to write a tricky line, say so: "Let me write this condition carefully, give me a moment."
- "I'll keep `start` as the left edge of the window and `best` for the answer."
- "I'm storing the last index of each character so I can jump the start pointer."
- "I'll handle the empty input case at the top so the loop stays simple."
- "I'm going to write this helper as a separate function to keep the main loop readable."
Stage 5: Getting stuck
This is where narration matters most. Silence here is the most damaging thing in a coding interview.
Useful phrases:
Asking for a hint after a few minutes of genuine effort is normal and often expected.
- "I'm stuck on how to update the start pointer when the repeated character is before the current window. Let me trace through an example."
- "I'm considering two options: using a set and shrinking one step at a time, or jumping directly. Jumping is faster but I need to make sure start never moves backwards."
- "I've tried X and Y; would you mind giving me a hint on which direction to take?"
Stage 6: Testing
Walk through your code with the example and edge cases, saying values aloud.
Useful phrases:
- "Let me trace 'abba'. At index 2, 'b' repeats, so start moves to 2. At index 3, 'a' was last seen at 0, which is before start, so start stays at 2. Good — that's the case I was worried about."
- "Edge cases: empty string returns 0, a single character returns 1, all same characters returns 1."
Stage 7: Wrapping up
Summarise the solution, complexity and possible improvements.
"This runs in O(n) time and O(k) space, where k is the size of the character set. If the input were a stream, I'd keep the same window logic but would need to bound the map size."
Narrate decisions, not keystrokes. "I'm using a hash map because I need constant-time lookup of the last position" is useful. "Now I'm typing for, i, equals, zero" is noise.
Common narration mistakes
- Going silent when the problem gets hard.
- Narrating so continuously that you cannot think, and the interviewer cannot get a word in.
- Talking about what you are going to do for too long without starting.
- Ignoring the interviewer's comments while talking.
- Apologising repeatedly instead of describing what you are trying.
How to practise
It feels awkward for the first few sessions. After ten or fifteen problems, explaining while you code becomes much more natural, and you will often find it helps you think more clearly too.
- Solve problems aloud alone, recording yourself on your phone. Listen back for silences and unclear explanations.
- Practise with a friend who plays the interviewer and gives hints.
- Use the stage structure above for every practice problem until it becomes habit.
- After each session, note one narration habit to improve next time.
Getting to the coding round
Narration skills pay off once you reach the technical rounds. Keep your resume clear about your languages and projects — the Algnetic ATS resume builder checks it against postings — and let auto-apply keep applications moving while you practise.
Key takeaways
- Narrate your reasoning at every stage: clarify, example, approach, code, debug, test, summarise.
- Narrate decisions and intent, not every keystroke.
- When stuck, describe what you have tried and ask for a hint rather than going silent.
- Trace your code aloud with examples and edge cases.
- Practise by recording yourself and doing mock interviews.
Let Algnetic apply to matching jobs for you · More career guides
Related guides
https://algnetic.com/blog/how-to-think-out-loud-in-a-coding-interview