Skip to content
Sharp

Interview Strategy · interview question

A bug appears around thinking aloud through code. What is the strongest first debugging move?

Multiple choiceMediumchapter-20-curatedpremiuminterview-strategythinking-aloud-through-code
python
def running_total(lines: list[int]) -> int:
    total = 0
    for line in lines:
        total += line
    return total
Choose one answer
Answer and explanation

Correct answer

B. Trace one concrete example, inspect the state transitions, and compare them to the intended rule before rewriting anything.

Why

That approach is reliable because it creates evidence. Jumping to a rewrite before understanding the code often signals weak debugging discipline.

Test yourself on Interview Strategy

A free test with instant, explained results. No account needed.

Start free test
All Interview Strategy questions →