Cognizant interview question

Basic queries