Skip to content
Sharp

Debugging · interview question

A bug appears around tracebacks and root cause. What is the strongest first debugging move?

Multiple choiceMediumchapter-5-curatedpremiumdebuggingtracebacks-and-root-cause
python
def line_total(price: float, quantity: int) -> float:
    return price * quantity


print(line_total("9.99", 3))
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. Replacing every exception with a vague generic message erases the clue that would have shortened the investigation.

Test yourself on Debugging

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

Start free test
All Debugging questions →