GlobalLogic interview question

How garbage collector works in .Net?