Cognizant interview question

even , odd form array reverse a string