In 1 minute
- Reproduce the failure and reduce the scenario before changing code.
- Form hypotheses that can be contradicted and choose tools to observe evidence.
- After fixing, check the original scenario, preserve valid cases and remove temporary instrumentation.
A live debugging interview asks you to investigate a failure while explaining observations, unknowns and the next experiment. Your first idea may be wrong; what matters is testing it against evidence. Changing several places until a symptom disappears does not establish the cause or show that other behavior was preserved.
This guide starts with an existing failure and follows investigation toward a verifiable fix. Building a new solution belongs in the live coding guide. Here, work begins before editing: separate expected and observed results, reduce the scenario and choose a question that running code can answer.
How to organize a live debugging interview
Ask for a failure description and confirm correct behavior with an example. 'The screen looks wrong' must become observable, such as 'after selecting the second item, details still show the first'. Confirm the environment, data and known steps. Without a clear expectation, you may change intentional behavior or replace one unexpected result with another.
- Record expected and observed results for the same input.
- Reproduce before editing and note the smallest steps that retain the failure.
- Choose a hypothesis and an observation that can support or reject it.
- After fixing, repeat the original scenario and check a neighboring behavior.
In a pair programming session, agree who drives experiments and who records findings. One person can track event order while the other inspects values. Before switching roles, summarize rejected hypotheses. That avoids repeating attempts because previous reasoning remained only in the driver's memory.
Reproduction and scenario reduction
Repeat the reported steps without changing code. Determine whether failure is consistent or depends on specific data, action order or a slow response. Record the condition instead of immediately calling the behavior random. Where possible, remove irrelevant elements: fewer records, one action and a controlled response make investigation easier to follow.
Reduction does not mean deleting everything until the project breaks. Preserve the relationship causing failure. If the issue appears only when two operations overlap, testing one operation removes the important condition. Record similar cases that work too. Their differences can identify the next useful investigation before you inspect unrelated code.

One hypothesis at a time, with evidence
Do
- Write a claim that can be contradicted: 'the correct item reaches the function, but selection uses another identifier'. Then choose where to inspect both values.
- A temporary log may compare inputs; a breakpoint can follow execution without scattered messages. Use the tool that answers the question.
Avoid
- Adding many generic logs and hoping one looks suspicious.
If evidence contradicts your hypothesis, say so and update the plan. Do not preserve an explanation because it initially sounded convincing. Distinguish symptom, mechanism and cause: stale display is a symptom; applying an obsolete result may be the mechanism; a missing validity rule may be the code-level cause. Each level needs its own evidence.
Example: a lost state update
Consider a component that records two steps from one click. The failing version calls the setter twice using the same array captured by that render. You expect two entries, but the second update replaces the first result. Reproduce the click and inspect the list before discussing a fix. The example places failing and corrected handlers side by side.
import { useState } from "react";export function StepLog() {const [steps, setSteps] = useState<string[]>([]);function recordBroken() {setSteps([...steps, "started"]);setSteps([...steps, "finished"]);}function recordFixed() {setSteps((previous) => [...previous, "started"]);setSteps((previous) => [...previous, "finished"]);}return (<section aria-label="Step log"><button type="button" onClick={recordBroken}>Run broken</button><button type="button" onClick={recordFixed}>Run fixed</button><ol>{steps.map((step, index) => <li key={index}>{step}</li>)}</ol></section>);}
In the corrected version, each updater receives the preceding pending state in the queue, so the second preserves the first addition. Updaters only calculate arrays and make no external calls. Compare buttons from a fresh component instance each time. This example is append-only; allowing reordered entries would require reconsidering identity.
A regression test should click once and expect both steps in order. A second click should append two more without removing earlier entries. This checks the rule rather than setter naming. The front-end testing guide helps choose checks that remain useful after internal component reorganization.
Fix verification, regression and explanation
Repeat the scenarios
After fixing, run the minimal scenario and return to the original steps.
Check regressions
Check that previously working cases remain intact.
Review the change
Remove temporary instrumentation and review the diff to separate necessary changes from investigation edits. Interview code review helps identify side effects that a reduced reproduction may not reveal.
Explain the cause through the supported sequence: input, executed path, observed state and reason for divergence. Then show why the edit changes that path and which test protects the rule. If the cause remains unknown, state rejected hypotheses and the next observation. For a different scenario, the async autocomplete challenge is Pro and provides practice with concurrent request behavior.
Frequently asked questions
How does a live debugging interview work?
You investigate a failure while explaining hypotheses and experiments. The expected result may be diagnosis, a fix or a proposed next check. Confirm that expectation and start with reproduction.
Can I use logs and breakpoints during the interview?
Confirm permitted tools. When available, use logs to observe values and breakpoints to inspect a specific path. Explain the question the tool will answer and remove temporary instrumentation afterwards.
What if I cannot reproduce the bug?
Compare environment, data and action sequence with the original report. Record attempts and request information distinguishing the scenarios. Failure to reproduce does not mean resolution; propose an observation that reduces uncertainty.
How can I explain a bug I could not fix?
Describe the confirmed symptom, rejected hypotheses and the point where evidence ran out. Propose the next investigation with an expected result. This explains your process without presenting suspicion as proven cause or an attempted change as a fix.
Practice with real tests
Solve front-end exercises in the browser, with the same tests a reviewer would run.
See the exercises