Cognizant interview question

Basic code like Palindrome and binary search