Pergunta de entrevista da empresa Barclays

Technical Coding Test Question: Given a string as input, check if it is a palindrome. (A palindrome is a sequence of characters which reads the same backward or forward. e.g., “abccba” - Palindrome “aabbcc” - Not a palindrome)

Respostas da entrevista

Sigiloso

27 de ago. de 2015

That implementation of IsPalindrome (posted Aug 24, 2015) is not correct. Words like "level" and "radar" have odd number of characters and are palindromes, but would return false using that code. Also using ToCharArray() is not necessary since a string has an indexer. Finally, a phrase can be a palindrome like "race car", so any algorithm needs to take that into account and ignore non-alpha chars.

2

Sigiloso

23 de jun. de 2015

To create an algorithm to ultimately solve this solution, I had to rely on simple and basic algorithm construction, string manipulation and recursion. (Theoretical stuff you learned in college Computer Science courses.) The knowledge never came, succumbed to pressure and gave up. The interviewer sounded pretty annoyed.