Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 77 ยท How Interviews Work

Thinking Out Loud and Handling Hints

Learn how to narrate your reasoning, test assumptions, recover from a blank mind and ask for hints in a coding interview without losing points.

In a coding interview, silence is the enemy. Not because thinking is bad, but because the interviewer cannot tell the difference between "deep in a good idea" and "completely lost". They cannot score what they cannot hear. Thinking out loud turns your private reasoning into evidence.

This lesson covers how to narrate without rambling, how to test your own assumptions, what to do when your mind goes blank, and how to ask for and use hints in a way that helps your score instead of hurting it.

What to narrate

You do not have to speak every thought. Narrate decisions and checkpoints.

Four things worth saying

Restate So I need the longest run of unique letters.
Examples Try a tiny input by hand.
Options Brute force first, then better.
Checks Trace your code on an example.

Say what you will do before you do it.

1 / 2

A good rhythm for a coding problem is: restate, ask about constraints, work an example by hand, propose a simple approach, state its cost, improve it, then code, then test.

Sample narration

Suppose the problem is "return true if a string has all unique characters".

"So the input is a string and I return a boolean. Can it contain uppercase and Unicode? Let me assume any characters. Example: 'abca' is false because 'a' repeats. The simplest idea compares every pair, which is quadratic. A better idea remembers characters I have seen in a set, so one pass and linear time, with extra memory. I will code the set version."

That took about 25 seconds and the interviewer now knows your approach, its cost and your assumptions. Here is the code that follows from it:

JS From narration to code

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The comments mirror what you would say. When you finish, walk through the tests aloud, including edge cases like the empty string, before the interviewer has to ask.

Test your assumptions early

A hidden assumption is the most common reason for a correct-looking but wrong answer. Ask early, and say your default if the interviewer shrugs.

  • Input size: "Roughly how large can the input be?" This decides whether quadratic is acceptable.
  • Input quality: "Can the array be empty, contain duplicates, or contain negatives?"
  • Output form: "Should I return the indices or the values? What if there is no answer?"
  • Environment: "Can I use the standard library?"

If the interviewer says "your call", state it: "I will assume ASCII and non-empty input, and mention how to change that." Stating the assumption is enough; you have shown awareness.

When your mind goes blank

Everyone blanks sometimes. The trick is to have a script, so panic has somewhere to go.

  1. Pause and breathe. Say "Let me think for a moment." Ten quiet seconds is fine.
  2. Return to an example. Work a tiny input by hand and watch what you do. Often the algorithm is hiding in your own steps.
  3. Say the brute force. Even a slow solution is progress, and it gives you something to improve.
  4. Simplify. Solve a smaller version (sorted input, only positive numbers), then relax the restriction.
  5. Ask. If two minutes pass, ask for a nudge.

A slow, correct solution that you improve beats a clever idea you cannot finish. Interviewers can almost always give credit for the first and rarely for the second.

Asking for hints well

Asking for a hint is not failure. Real engineering is collaborative, and interviewers are often told to help. What counts is how you ask and what you do with the answer.

  • Be specific. "I see two options, sorting first or a hash map, and I cannot decide which fits. Any direction?" is much better than "I don't know".
  • Show your work first. Name what you tried and where it broke.
  • Use the hint visibly. "Ah, since the array is sorted I can use two pointers." Then follow through.
  • Do not argue with a hint unless you can show it fails; then explain why.

The hint ladder

Interviewers often give hints in stages from vague to specific. Knowing the ladder helps you ask for the smallest hint you need. Here is a stand-in that models it. It is not any real company's system, just an illustration of how hints cost progressively more.

JS A hint ladder

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The numbers here are invented to show the shape: each hint costs a little, but running out of ideas silently costs more than a hint would. A candidate who needs two small hints and finishes usually looks better than one who struggles alone and ends with nothing.

Recovering from mistakes

You will write a bug. When you notice it, say so calmly: "I see an off-by-one here, the loop should stop one earlier." Fixing your own bug fast is a positive signal. If the interviewer points out a bug, thank them, trace it, and fix it without defensiveness.

If you realize your whole approach is wrong, say it early: "This will not handle duplicates. I will switch to a map." Switching with five minutes left is better than defending a dead end until time runs out.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why should you narrate your reasoning in a coding interview?

    Problem solving is scored from what the interviewer observes, so silent progress is invisible.
  2. 2. Your mind goes blank. What is the best first step?

    An example or a brute-force baseline restarts your thinking and gives the interviewer something to work with.
  3. 3. Which is the best way to ask for a hint?

    Showing what you tried and asking a specific question demonstrates progress and lets the interviewer give the smallest useful nudge.
  4. 4. You find your approach cannot work. What should you do?

    Recognizing a dead end early and adjusting is exactly the judgment interviewers look for.

Summary

  • Narrate decisions and checkpoints: restate, example, options, cost, code, test.
  • Ask about size, input quality and output form early; state defaults you assume.
  • When blank: pause, work an example, say the brute force, simplify, then ask.
  • Ask for hints specifically, show what you tried, and use the hint visibly.
  • Fix your own bugs calmly and abandon dead ends early.

Next: Building a Study Plan and Practice Routine