Guide · coding-prep
How to Explain a LeetCode Solution Out Loud in an Interview
Narrate in four passes: restate the problem, walk through a brute force, propose the optimization with its complexity, then code while talking. The narration, not the code, is what gets you the offer. Explaining your coding solution out loud is the skill the interviewer is actually grading.
By Sam K., Founder, InterviewChamp.AI · Last updated
How do you explain a LeetCode solution out loud in an interview?
Narrate in four passes: restate the problem, walk through a brute force, propose the optimization with its complexity, then code while talking. The interviewer is grading your reasoning, not your typing speed. A clean solution explained badly fails more often than a brute force explained well. Explaining a coding solution out loud is a learnable script, and the rest of this guide is that script, pass by pass.
For a CS new grad in the 2026 hiring cycle, sending hundreds of applications for a handful of onsite slots, this is the skill that converts a slot into an offer. The candidates who get the offer are rarely the fastest typists. They're the ones who can say the answer in their own voice while their hands work. I'd put narration above raw problem-solving speed nine times out of ten, and the rubrics back me up.
Why narration beats correct code
A coding interview is a signal-gathering exercise. The interviewer can't read your mind, so the only reasoning they can grade is the reasoning you say out loud. Signal density, how much useful evidence of your thinking you produce per minute, is the thing that actually moves a rubric, and silent correct code produces almost none of it.
Here is the contrast that decides most rounds:
| Moment in the problem | Weak (silent) version | Strong (narrated) version | |---|---|---| | First 60 seconds | Start typing immediately | Restate the problem, ask about input size and duplicates | | Choosing an approach | Quietly write the optimal solution | "Brute force is O(n²); a hash map gets me to O(n), here's the tradeoff" | | Mid-solution stall | Long silence, eyes on the screen | "I'm going to think for thirty seconds, is that okay?" | | Hitting a bug | Backspace and retype quietly | "Let me trace a small example. Ah, off-by-one on the boundary" | | Finishing | "Done." | "Time O(n), space O(n), handled empty input and duplicates. Anything to refactor?" |
The right-hand column isn't smarter. It's just audible. That's the entire difference between a hire and a no-hire when two candidates reach the same answer. The same logic drives the broader habit covered in the guide on how to think aloud during a coding interview. This page is the structured walkthrough script; that one is the minute-to-minute talking habit underneath it.
The four-pass method, step by step
Use the same four passes on every problem, from a warmup two-pointer question to a hard graph problem. The structure is what keeps you from freezing.
- Restate the problem and ask clarifying questions (about 60 seconds). Read it aloud, paraphrase it back, and ask whether the input can be empty, whether values are unique, whether it's sorted, and what input size to optimize for. Picking sane defaults and stating them is engineering judgment; coding silently is not. The deeper version of this move lives in the guide on handling clarifying questions on a coding problem.
- Walk through a brute force and label its complexity (about 2 minutes). Always have a baseline ready, even if you never code it. Say "the naive approach is O(n²)" and trace it through a 3-to-5-element example so you catch bugs and confirm you understood the question.
- Propose the optimization and state complexity before coding (about 2 minutes). Name the data structure or observation that removes the bottleneck, then announce time and space cost out loud. This is where the offer is won or lost.
- Code while narrating, then trace the result (5-10 minutes). Speak every non-trivial line, fix typos silently, and finish by tracing your small example through the finished code and restating the complexity.
If the problem itself is one you've never seen before, run this same structure but slower. The guide on how to handle a coding problem you have never seen shows how to shrink an unfamiliar problem until Pass 1 becomes possible.
Pass 1: Restate the problem (60 seconds)
Read the problem out loud, then paraphrase it back. This catches misreads early and shows the interviewer you're not just pattern-matching to a memorized solution. Ask:
- "Can the input be empty?"
- "Are values unique, or can there be duplicates?"
- "Is the input sorted?"
- "What's the expected input size, should I optimize for time, space, or both?"
If the interviewer answers with shrugs, pick reasonable defaults and state them. "I'll assume non-empty input with up to 10⁴ elements" is engineering judgment. Coding silently is not.
Pass 2: Walk through a brute force (2 minutes)
A brute force is the most obvious correct solution, written without any optimization, usually the nested-loop version. Always have one ready to discuss, even if you'll never code it. The format:
"The naive approach is to do X for every Y. That's O(n²) time and O(1) space. I think we can do better, but let me make sure that's actually correct first."
Then trace it through a tiny example (3-5 elements) on the whiteboard or shared editor. You'll catch off-by-one bugs, confirm you understood the problem, and give the interviewer a chance to redirect you if you're solving the wrong problem.
Levels.fyi's interview analysis, drawing on thousands of post-loop debriefs, consistently flags "jumped to code without confirming the problem" as the most common reason strong candidates get downgraded.
Pass 3: Propose the optimization with complexity (2 minutes)
This is where the offer is won or lost. Time complexity is how the runtime grows as the input grows, written in Big-O notation, the upper-bound shorthand like O(n) or O(n log n) that interviewers expect on every solution. The pattern:
"We can avoid the nested loop by [data structure / observation]. That trades O(n) extra space for O(n) time. The intuition is [one-sentence why]."
Then state the complexity out loud before coding:
- "Time: O(n), single pass through the input."
- "Space: O(n), hash map sized to the input."
- "Edge cases I want to handle: empty input, single element, duplicates."
Saying complexity before coding signals you understand the structure of the algorithm, not just the syntax. It also gives the interviewer a chance to nudge you if your complexity claim is off, and that nudge is gold. If complexity is the part that trips you up, the guide on how to explain time complexity in an interview drills the exact phrasing.
Pass 4: Code while narrating (5-10 minutes)
Now you write. Two rules:
- Speak every non-trivial line. "I'm initializing the result as an empty list. Now I iterate through the input, and for each element, I check whether its complement is in the hash map…"
- Don't apologize for typos. Fix them silently. Apologizing every time you backspace tanks the perceived signal density of the recording.
When you finish, trace through your code with the same small example you used in Pass 2. Catch bugs live. End with: "Time complexity is O(n), space O(n), and edge cases I've handled are empty input, single element, and duplicates. Anything you'd like me to refactor?"
That last question matters. It hands the interviewer back the lead and signals you can take feedback.
The language you narrate in matters here too. Pick the one whose standard library lets you say less and do more, which the guide on how to choose a coding language for a CS interview breaks down by problem type.
What to do when you get stuck
Get stuck out loud. A silent stall, a long pause with no narration, reads as panic; a verbal stall, where you say what you're considering, reads as engineering:
- "I'm going to think for thirty seconds, is that okay?"
- "I don't immediately see the optimization. Let me try a smaller example."
- "What if I sort the input first? That's O(n log n), better than O(n²), worse than O(n)."
Per the Pragmatic Engineer's writing on interview signal, the difference between a hire and a no-hire often comes down to whether the candidate kept the room informed when they hit a wall. The technical bar matters less than you think; the communication bar matters more.
How to practice explaining out loud
Reading this method does almost nothing; saying it under time pressure builds it. As of 2026, nearly every CS new-grad loop runs over a webcam on a shared editor (CoderPad, HackerRank, or a plain Zoom screen-share) so practice into the same channel:
- Pull a medium problem from LeetCode or NeetCode, set a 30-minute timer, turn your camera and mic on, and screen-record the whole thing.
- Watch it back with the sound on. Count the silent stalls and the times you started coding before stating complexity.
- Re-run the same problem the next day and narrate the parts you skipped. The point isn't a fresh problem; it's a smoother walkthrough.
The fastest way to feel the gap between your silent code and your narrated code is to hear yourself once before it counts. You can run a practice round and walk through a problem out loud while a real-time coach surfaces the question and follow-ups, so the live interview isn't the first time you've said the answer in your own voice. If you want unlimited timed reps through the 2026 hiring season, see how live coaching turns a clean walkthrough into an offer, the same approach that starts at a $3 trial.
For a structured study sequence to pull problems from, the LeetCode 75 vs Blind 75 vs NeetCode 150 breakdown maps which list to grind first, and the coding interview cheat sheet collects the patterns most worth narrating fluently.
Key terms
- Coding interview
- A live technical round where you solve a programming problem in a shared editor while an interviewer watches and grades your reasoning, not just your final answer.
- Brute force
- The most obvious correct solution, written with no optimization, usually the nested-loop version. Stating it first shows you can reason about a baseline before improving on it.
- Time complexity
- How a solution's runtime grows as the input grows, expressed in Big-O notation such as O(n) or O(n log n). Interviewers expect you to state it out loud before and after you code.
- Big-O notation
- The standard shorthand for the upper bound on how an algorithm scales, ignoring constants. The language interviewers use to compare approaches.
- Signal density
- How much useful evidence of your thinking you produce per minute. Narration raises it; silence and constant filler chatter both lower it.
- Verbal stall
- Saying what you're weighing while you're stuck ("let me try a smaller example") instead of going quiet. It reads as engineering; a silent stall reads as panic.
About the author: Sam K. is the founder of InterviewChamp.AI and writes about the modern tech interview from the inside: what changed, what works for new grads, and where the old playbook fails.
Frequently asked questions
- Should I write code first or explain my approach first?
- Explain first. If you start coding without saying your plan out loud, the interviewer can't help you when you get stuck, and they will help you if they understand where you're going. The plan should take 2-4 minutes before any code is written.
- What if I don't know the optimal solution?
- Say so out loud, then propose the brute force and code it. A brute force you actually finish beats an optimal solution you don't. Most interviewers grade on signal density, not on whether you hit O(n).
- How do I keep talking while I'm thinking?
- Narrate your tradeoffs ('I could use a hash map for O(1) lookup, but that's O(n) extra space; let me check if the input is bounded') even if you pause. Silence reads as stuck; tradeoff talk reads as engineering.
- Is it okay to ask the interviewer questions during the problem?
- Yes, especially in the first three minutes. Ask about edge cases, input size, whether duplicates are allowed, and whether you can mutate the input. Each question is a signal that you think before you type.
- What if I write code that doesn't compile?
- Walk through it line by line and find the bug yourself. Saying 'let me trace through this with a small example' and catching the bug live is a stronger signal than perfect code on the first try.
- How do you explain your code in a coding interview?
- Work top-down, not line-by-line. State the goal of each block before you write it ('this loop finds the complement for every element'), narrate the decisions and tradeoffs, and stay quiet during the obvious typing. The interviewer can only grade reasoning they can hear, so make the structure audible and skip the variable names.
- How do I walk through a LeetCode solution out loud when practicing alone?
- Record yourself solving a medium problem with your camera and mic on, then watch it back with the sound on. As of 2026 most loops are remote, so practicing into a webcam mirrors the real channel. You'll hear every filler word, every silent stall, and every place you jumped to code before stating complexity, the exact gaps a live interviewer marks down.