Earlier quoted context omitted.
So you are saying that many people failed to type "FizzBuzz code" in Google? I do not really buy that.
I am commonly asked to reverse a C string. The first time I did that, I wrote out what I regarded as the obvious solution. The owner of the company pointed out that I had paid attention to performance. That had me puzzled - while I could see that there are lots of really slow ways to reverse C strings, I found it hard to believe that anyone would provide slow solutions to such a simple problem in a job interview. I g…
These sorts of overly complex solutions usually indicate someone who doesn't actually know how C strings work/how they're stored in memory. Reversing a string is one of the instances where these weaknesses show up. I've seen various people with degrees in CS who claim to have worked with lots of C do this problem, and it's almost amusing the volume and variety of code they can produce for such a simple problem. What should only involve two array indices or pointers in a loop can turn into something containing numerous malloc()s (often with no free()s), copious copying and moving of data around, recursion (this one isn't so bad), and I've even seen sprintf() make an appearance.
However, none of this compares to one individual whose quite memorable solution involved creating a temporary file, writing the string into it, then executing an external command to reverse that file, and reading it back in. His reasoning was "because I don't want to reinvent the wheel."
(Related article about std::string in C++: https://news.ycombinator.com/item?id=8704318)