Cognizant interview question

Was asked to write a simple palindrome code