Skip to content
Sharp

Python Internals · interview question

A bug appears around reference counting and gc. What is the strongest first debugging move?

Multiple choiceHardchapter-19-curatedpremiumpython-internalsreference-counting-and-gc
python
import gc

print(gc.get_threshold())
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. Assuming the runtime will eventually solve every memory problem can hide real lifecycle design mistakes.

Test yourself on Python Internals

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

Start free test
All Python Internals questions →