Unless you're giving that problem and then hitting the input with a string that includes directional formatting characters. Because that's exactly what is going to happen in real life.
The only good thing about that question is at least you didn't ask them to casefold the string.
The magic of engineering isn’t doing what you’re told. It’s understanding and solving a problem someone has told you about.
My org doesn’t need the guys who need exhaustive instructions to take the next step. It needs those who can make good Bayesian inferences, reason inductively, and figure out problems.
So yes, it does filter out people with lots of knowledge who nonetheless lack these skills.
Worst: spend the entire interview explaining why you can't solve this problem.
I find "reverse a string" a good interview question then! If the applicant got lost in considering all possible interpretations instead of just solving it how 99% of humans/engineers would understand it, then they will likely be unfit for working in a team and/or have poor communication skills.