Palindromes testing is very representative in terms of QA way of thinking. Moreover, writing tests dramatically increase the quality of task specification. When a QA engineer writes test cases, it well may happen that certain case is not covered in initial specs. This is a good reason for QA to come up with idea to improve those specs.
So, when you are asked for more test cases during an interview, they really want to make sure you think like a QA.
Let's see what test cases can be written. First, palindromes are based on strings, so you have to enforce common string testing:
- Null string
- Empty string - is it a palindrome? Probably not, but naive algorithm would return positive result.
- Spacing and punctuation, as @dzieciou has noticed
Zero-width diacritic marks introduce several tests:
é
(Latin small E with Acute Accent) can be represented in two ways, U+00E9
and U+0065 U+00B4
, are they equal?
- Naive reversing
U+0065 U+00B4
would ruin the character, so it has to be tested as well;
- Finally, can
é
and e
be considered same character, in terms of palindrome?