What's that have to do with anything? In my example the function returns a type of string which doesn't exist in C.
The simplest version of the function is one that takes an integer and returns a string. This isn't a trick question and it's not difficult to answer or judge the answer if you take the time to learn it. Assuming that you're going to be hiring a programmer without one handy to help you then you need to read a few books and learn a few things. It's not that hard if you're sufficiently motivated to learn.
I was illustrating the point that even the most minor of things can have many completely different looking but acceptable solutions.
There's way way more than "one or two" ways to solve it if a non-programmer is judging. Non-programmers won't have a command of the language necessary to parse uncommon syntax and idioms.
If you define the parameters correctly there are really only two ways to solve itoa that I know of. Problems like this always have rules and boundaries.
Besides the people who this question would screen could not tell you what an allocator might even be.
I've asked this question 100-150 times now and I think I've seen everything at this point. The working solutions all look the same or pretty darn close.
Yea but there may be an unbounded number of approximation methods that aren't the textbook answer but still diagnostic of competence on behalf of the answerer.
I want a solution to the problem on the terms I defined or they have to give me a pretty good reason why they can't solve it. I usually give tons of hints and let them ask many questions. This never helps those who can't program.