Pregunta de entrevista de Questrade

How does garbage collection work?