Cognizant interview question

Background