Amazon Interview Question

how will you implement garbage collector in c++