Always fun to see this kind of Rosetta Code thing, feel like no matter the topic there's something to glean from reading!
That said: if I ever gave the palindrome question to a candidate (I haven't) and they pulled out a `reverse` library func/keyword we'd be encouraging them to do more.
Haskell's default `String` type is a singly-linked list of `Char` values[0] so it takes O(n) time to access the end of the string. Hence I think the solution using `reverse` is probably the best there is, since any attempt to be "smarter" would just be more complicated for no real performance gain. Though I agree that we could ask someone to also write their own reverse function.
Yeah spot on - exactly what I was aiming at too...
Having the intuition to use reverse (& pragmatism to keep it simple) is a great sign, and realistically more valuable [to me] for hiring than implementing rudimentary algorithms, but... still want at least a bit of both abilities
Also knowledge of standard library / language features is useful but (for me) doesn't equate to abilities in complex problem solving.
I generally say something like "You can use whatever libraries you like but I reserve the right to ask you to implement them yourselves". This allows them to focus on the part they want to focus on and shows good decision making about not re-inventing the wheel, but if they "outsource" the core of the problem (or we just have extra time) there is an obvious step deeper that can be taken.
I usually even say that they can make up library APIs if they want, because I don't really care if they have memorized the python stdlib, I just want to seem them think about and work on a coding problem.
That said: if I ever gave the palindrome question to a candidate (I haven't) and they pulled out a `reverse` library func/keyword we'd be encouraging them to do more.