Samsung Electronics interview question

Check if a string is palindrome in C and optimize the code