Gong interview question

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