Cognizant interview question

Program in any language