I have interviewed several candidates specifically focusing on their C++ knowledge, and if there was one question that worked well to put peoples' knowledge of C++ on a gradient, it was this one:
Fix this memory leak as robustly as you can:
void doSomething()
{
Foo* pFoo = new Foo();
[do some stuff]
}
-
+1 for putting delete pFoo at the end
-
+2 for putting pFoo in a std::auto_ptr
-
+3 for knowing what RAII is - the concept, if not the acronym
-
+4 for mentioning exception-safety guarantees of the auto_ptr
-
+5 for putting pFoo in a boost:shared_ptr
-
+6 for knowing when a shared_ptr might not be freed.
-
+7 for talking about garbage collection techniques to fix circular references
This always worked to show how long someone had been working with C++. This is one datapoint you can use to tell where you are in the scale of C++ knowledge.
Edit: I would recommend someone for hire at level 3 or above.