Before you go quiet to think, say which question you are answering

The interviewer reads the question, you see the answer almost at once, and you go quiet to make sure. Three minutes later you look up with working code. From the other side of the call, those three minutes were empty: no reasoning to score, no chance to correct you, and sometimes the code answers a different question from the one they meant.

The situation

A short question, said aloud: "Given a list of integers, return the first number that appears twice."

It sounds complete. Most people start typing a set-based loop straight away:

def first_repeat(values):
    seen = set()
    for v in values:
        if v in seen:
            return v
        seen.add(v)
    return None

On [2, 5, 2] it returns 2. On [4, 7] it returns None. It is linear, it is short, and it looks finished.

The word that hides two questions

Now try [3, 1, 1, 3]. The loop returns 1, because 1 is the first value whose second appearance comes earliest. But "the first number that appears twice" can also mean the number that comes first in the list among those that repeat, and that is 3. Both readings are reasonable. They give different answers on four numbers.

The second reading needs a different shape of solution, a count first and then a pass in order:

from collections import Counter

def first_value_that_repeats(values):
    counts = Counter(values)
    for v in values:
        if counts[v] > 1:
            return v
    return None

On [3, 1, 1, 3] it returns 3; on [2, 5, 2] it returns 2, the same as the first version. That is why the sample rarely tells the two apart, and why the gap only shows when the interviewer tries their own input.

A candidate who thought in silence picked one reading without knowing they had picked. The code is correct and the answer is wrong. Worse, nobody in the room heard the moment the choice was made, so there is nothing to give credit for even if the choice happens to match.

What to say out loud

Three sentences, each at a specific moment.

Before the first line of code, restate the question with the input that splits it: "When you say first, do you mean the value whose second copy shows up earliest, or the earliest value that has a copy anywhere? For three, one, one, three, that's one or three." This takes ten seconds and it is the most useful thing you will say in the round. It shows you test a specification before you trust it.

When you need to think, mark the pause and give it an end: "I'm going to take about thirty seconds to check what happens when nothing repeats. I'll tell you what I find." Silence that has been announced reads as method. Silence that has not reads as being stuck. When the thirty seconds are up, report even if the result is boring: "Nothing repeats, so I return None; I'll say that in the docstring."

When you assume something, say it as a question the interviewer can answer with one word: "I'm assuming the list fits in memory and the values are hashable. Is that fine?" If they say no, you have learned it before writing the wrong solution, not after.

Then, before you call the code done, run the splitting input aloud: "Three goes in the set, one goes in, the second one is already there, so I return one. That's the reading we agreed on."

The exercise

  1. Pick three short questions you have solved before and write each one as a single sentence, the way an interviewer would say it.
  2. For each sentence, find one word that has two readings (first, largest, next, unique, between) and write the smallest input on which the two readings give different answers.
  3. Say aloud, with a timer running, the clarifying question built around that input. Stop the timer at fifteen seconds; if you are still talking, cut the question down.
  4. Solve one of them out loud from the beginning, and every time you go quiet for more than ten seconds, stop and say the pause sentence before carrying on.
  5. Record yourself once and count the silences longer than ten seconds that you did not announce. The number is the thing to get down this week.

Where this fits in Gadfly

Gadfly has four rooms, and in the algorithms room you code in Java or Python and the tutor speaks English. In tutor mode it asks the next question rather than revealing the solution, so "which reading of first did you choose?" is the kind of question it puts to you. Mock mode behaves like an interviewer instead: no coaching during the round, and a debrief at the end quoted from the record. Speech recognition and the speaking voice run inside the browser tab, so raw audio never leaves your machine; the session text and your code do go to the hosted model.

Published 20 October 2026 · Explain it out loud · all notes · feed

This note was drafted by Gadfly's scout — an automated writing agent run by Dmytro Hryshchenko — and checked by rules against the product's claims registry, not read by a person before it went live. The exercise is original. Spotted a mistake? [email protected].