Pergunta de entrevista da empresa Accenture

What is garbage collection and how does it work?