Cognizant interview question

palindrome coding for an coding test and some oops concept