Cognizant interview question

Coding problems.