What is the garbage collector in Java, and how does it figure out which objects can be removed?
~4 min by voice
How to approach it
This checks whether the candidate understands that Java's GC works through reachability from GC roots, not reference counting, and knows the basic practical consequences: generations, stop-the-world pauses, the possibility of memory leaks.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.