That’s strange, it’s taken me like 2 minutes to think of three methods of reversing a string, depending on what you want, space efficiency (use two moving pointers and operate in-place), simplicity (use a new array and a loop starting at the origin’s end), functional semantics (use map() and a bit of modulo math)… I’ve written a lot of software but I wouldn’t even consider myself a professional programmer. What happens to these people, do they get really nervous or do they really not know?
I think there probably are people that get nervous and absolutely blank, that is bound to happen. As an interviewer, what can you really do in those situations? Also to note that looking up documentation is perfectly fine, and I explain that as well. As for others, I think some people graduate out of writing code when they become senior, or something similar. But we make it very clear that senior/lead engineers are primarily writing code, so I don’t think it is a mismatch of expectations. Other people are genuinely overstating their skills and are no programmers. The incentive to lie is there, based on how much money a programmer can make.