Live Coding · 18 min · free with an account

Debugging Out Loud

Lesson preview · about 30%

Form a hypothesis and request one discriminating fact.

Core idea

Do not edit randomly during an interview.

Start with the idea

Do not edit randomly during an interview. Restate the symptom, identify the first impossible state, propose one hypothesis, and choose the smallest observation that can disprove it.

Start by restating the symptom in observable terms: which input, expected result, actual result, and whether the failure is repeatable. Separate a compile failure, runtime panic, wrong output, and performance regression because each suggests a different search path. Form one hypothesis that would explain the evidence. Then choose the smallest observation that could disprove it. Reading a diagnostic span or printing one value at a boundary is more useful than making three speculative edits at once.

Suppose a function returns an empty list only on the second call.

Keep learning, for free

The rest of this lesson is waiting for you.

Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.

No payment details. Your account opens the complete Academy.

← All lessons in Rust Interview Prep