Cognizant Interview Question

How GC algorithm works?