The worst interview question ever
petewarden.typepad.com
petewarden.typepad.com
http://news.ycombinator.com/item?id=982237
FWIW, I think most of the discussion is barking up the wrong tree, arguing against a straw-man.
I explain my view here:
http://news.ycombinator.com/item?id=982430
In essence, when I ask questions like this I don't really care about the answer. I care about the candidate's ability to reason, and sometimes, their ability to change their mind.
Arguing that the question is stupid is stupid. Talk about the process.
Some of the best programmers I have encountered in my carrier started out as Zoologists, Philosophy majors, some English Lit Majors, etc. etc. These people were able to make complex systems run an very limited hardware because the emphasis back then was to "Do the most with the least". Please see some of the early Unix tools for proof of concept.
As time went by, schools started to turn the crank and started to generate CS degrees. While this is good to a large extent, it has lead to an increase in specialization which in my opinion is detrimental to the industry overall.
The adage "When life gives you a hammer you tend to look at all problems as if they were nails" is an apt one, and is illustrated by the advancement of theory over function ( please look as most Industry Popular OSs for proof of concept ).
No longer are engineers required to "Do the most from the least", They are conditioned to build in obsolescence in their code by requiring that the users buy better hardware in order to accommodate the grandiose theoretical marvels.
The type of question that I have asked of the most successful programmers in the projects I have managed are simple direct questions that probe the individual's ability to deal logically with problems. Than explore their depth of understanding as far as the consequences of the decisions they make.
I have worked with far too many engineers that look for esoterica where simplicity is sufficient, and mistake density for elegance.
My personal recommendation is : Past performance is the best predictor of future performance. Look at the candidate resume, drill on the details as they pertain your requirements and use your knowledge of the subject matter to do the best choice.
It is not rocket science.
One of the biggest advantages (or disadvantages, depending on your needs) of c++ is the direct control you have over memory management. To me, being confused about "delete this" says you probably don't need or want that level of control, and you probably aren't making the most of it, either.