Pergunta de entrevista da empresa Google

The key thing was understanding how the java garbage collector worked.

Respostas da entrevista

Sigiloso

31 de ago. de 2010

It scans the stack, looking for pointers into the heap. Any object in the heap with no pointer is unused.

Sigiloso

4 de jun. de 2012

I don't understand why allegedly brilliant programmers keep asking this question. There is no single way garbage collection works because the JVMS doesn't even require garbage collection. It's JVM dependent.