Jane Street interview question

Implement Cheney's algorithm (garbage collection method)