Cognizant interview question

programming