Tech Mahindra interview question

They asked me about the code for palindrome