Skip to content
Sharp

Memory · interview question

A bug appears around tracing allocations. What is the strongest first debugging move?

Multiple choiceMediumchapter-16-curatedpremiummemorytracing-allocations
python
import tracemalloc

tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
print(snapshot.statistics("lineno")[:3])
Choose one answer
Answer and explanation

Correct answer

C. 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. Without evidence, teams often confuse growth, caching, and one real leak.

Test yourself on Memory

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

Start free test
All Memory questions →