Domanda di colloquio di Gong

How does basic garbage collection algorithm works, meaning how does he know which items are free and have no back reference.