Cognizant interview question

Asked we to write code for palindrome