Palindrome as an Interview Question
11/27/2022
Palindrome often comes up as an interview question. In this post I will investigate 3 implementations and their relative performance.
What is a palindrome? Wikipedia says A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar.
It is quite common to ask an interview candidate to implement a function to check if a given string is a palindrome. In this blog post I will show 4 different implementations. While these implementations might not handle all use cases identically, they satisfy a set of testcases to make sure they all work correctly based on a common interpretation.