Pregunta de entrevista de Susquehanna International Group

How would you implement a garbage collector for a programming language?