Cognizant interview question

They gave me a program to implement on the spot.