Barclays Interview Question

a code to write to check if a string is palindrome,