On this page
article
Interview Q&A #59
Data Structures interview question #19.
Category: Data Structures
Question
[Data Structures] Question #19: How does garbage collection work?
Answer
CPython uses reference counting plus generational cyclic GC to reclaim unreachable objects.
Expand your answer with examples from your projects and link to Interview Prep.
Follow-Up Questions
- Can you explain a trade-off involved?
- How would you test this in production?
- What could go wrong at scale?