Skip to content
Sharp

Performance · interview question

A bug appears around optimization boundaries. What is the strongest first debugging move?

Multiple choiceHardchapter-16-curatedpremiumperformanceoptimization-boundaries
python
def optimize_if_needed(elapsed_ms: float) -> bool:
    return elapsed_ms > 250
Choose one answer
Answer and explanation

Correct answer

A. 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. Over-optimizing easy code paths can make the whole system harder to understand for no user benefit.

Test yourself on Performance

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

Start free test
All Performance questions →