Sign in to follow this  
rAm_y_

How difficult(or not) do you find these C++ tests?

Recommended Posts

I would say it really depends on what you'd define as 'roll through'. From the few I looked at, I think many candidates would have their answers be marked as incorrect. They're quite full of small gotchas, instead of really testing someone's programming skills.

(But hey, that may just be my disappointment speaking biggrin.png )

 

That said, I'd be much more interested in why the candidate gave that answer. If a candidate knows what a reference, copy constructor, initialization list, etc. is, but just overlooked some small issue, I'd still would want to hire them.

Example: one of the tests checks if you know what happens if a local functor has the same name as a function and you call f(..). I don't care: anyone who programs something like that will be close to be fired on the spot or at least have a good talking to... wink.png

 

So as a test, I don't think these are particularly good. As a starting point for a technical discussion, they're quite nice.

Edited by DaBono

Share this post


Link to post
Share on other sites

I really don't like these kind of tests. Yes, they are called "c++ tests", but what is really tested here is specialized knowledge of a few very specific langauge concepts probably containing more than one gotcha. Almost like a trick question, and I don't like trick questions.

 

What I'd be more interested in a candidate is quickly grasping large-scale code structure, ability to visualize class dependencies, debugging, refactoring, all in all skills that are not bound to a specific language.

Share this post


Link to post
Share on other sites

They should change the title of the test in "Horrible C++ nightmare program test". Seriously, if someone in real life codes like that, it should be fired.

Edited by Alessio1989

Share this post


Link to post
Share on other sites

They aren't too bad if you take it slow (I get most of the answers correct but if I rush it I miss a detail or two), and I do agree that they'd be better suited for discussion rather than as a strict test.  And yes, no one would code like that, but I've taken C++ tests that have been written far worse and are loaded with more WTFs than these tests and these are more than reasonable in comparison.

Share this post


Link to post
Share on other sites

I didn't get any correct answers. I'm not at all sure (from a production standpoint) what the intent of the testing really is. It's perhaps similar to cutting and pasting someone else's code and debugging it. But, if I were to do that (and, of course, I have), I wouldn't spend a lot of time determining why or how the code does what it does, I would concentrate more on why it doesn't do what I want it to do.

 

It may be a test along the lines of examining example code from Microsoft. happy.png  Or, perhaps, the originators of the tests are cryptologists looking for people who are efficient at determining what purloined obfuscated code does. laugh.png

Share this post


Link to post
Share on other sites

Well, I consider myself a C++ expert, but I just took their C++ test #1, spent ~1:30 on each question, thinking "this is a stupid test, badly written and checking for esoteric quirks that only experts will know"... and apparently I took it too quickly because I missed subtle details on each one and got all 5 questions wrong. Taking it again and reading more carefully I found all my mistakes dry.png

So... I don't think I'd use that test to screen candidates laugh.png

 

As DaBono, they'd probably be more interesting as interview discussion topics, so you can see how well they can explain why different answers would be generated.

You can also see some other examples of esoteric questions in my C++ quizzes as well. Honestly these are never things I would really ask an interviewee to take partly because A) they're online, easy enough to google the answers for, and B) the knowledge isn't that useful in many cases, because learning it briefly for a test will NOT cause it to stick with you and thus ensure you do not make the same mistakes later on.

Share this post


Link to post
Share on other sites

I did the first test and took an average of 3 minutes per question and got 3/5 right, the mistakes I made were because I overlooked a few details. There were a few things that I feel like only an expert would know, but I don't think these tests are effective in measuring someone's level of expertise.

 

These kind of tests lack a programming goal, the code has no purpose. There's no context to place the code in, which sort of reduces the test to 'are you a good compiler?'. Programming is so much more than that.

Edited by Mussi

Share this post


Link to post
Share on other sites


ent ~1:30 on each question, thinking "this is a stupid test, badly written and checking for esoteric quirks that only experts will know"... and apparently I took it too quickly because I missed subtle details on each one and got all 5 questions wrong
Hahaha... that's too funny. Exactly what happened to me, and exactly what I was thinking, but I wouldn't want to post it because I found it too embarrassing biggrin.png

Share this post


Link to post
Share on other sites

I did pretty terrible at first: one correct answer. The later tests seemed easier, or perhaps I had "warmed up" (I don't actively use C++ any more). I've never worked with C++ professionally, but I'd expect an experienced C++ programmer should have vague familiarity with most of the concepts they are testing, even if only to know when to avoid the questionable practises. Some of the tests do cover important topics that are central to writing correct code.

 

While I made some genuine blunders that I probably wouldn't have made progress on without a live environment to experiment in or access to the Internet (or both), most of my mistakes were misreading what was going on. I understood the reasons behind most of the test cases, but still messed them up. Leaving aside random human error, I think a lot of my errors were introduced by the density of concepts in the tests, paired with the meaninglessness of the examples. In code that has meaning, I think it would be easier to spot and keep on top of these kind of details.

 

I think this test is incredibly poor as a filtering mechanism. I think it might put off good developers who like too write clean code and who don't pride themselves on being able to recite to the letter obscure areas of the language standard. In addition, I think it is too harsh, as developers with concrete skills can and will fail this test.

Share this post


Link to post
Share on other sites

Got one out of five correct (well, out of four, I gave up after the fourth question due to a major headache).

 

Now granted, I don't know too much C++, but it's pretty obvious the questions are designed so that unless you happen to know the exact way the standard defines an obscure expression, parse rule, or function overload selection, you will get the wrong answer. This makes it a really poor metric for testing programming skill, and leaves developers who are probably perfectly qualified for whatever job is being offered, feeling stupid.

 

And I agree with rip-off in that the tests are very confusing to read, thanks to the meaningless A, B, C, m_n type and variable names, and also the fact that a single error in the output fails the test ("oh, you answered dbbdbdddbcdc? sorry, it was dbbdbdbcdc. noob.").

 

You can tell it's HR people that come up with these tests, because no programmer would inflict such trainwreck of C++ code to fellow programmers dry.png (one can dream)

Share this post


Link to post
Share on other sites

Is it weird that my answer to most questions about the output of the program was: "the responsible programmer losing his job"?

Share this post


Link to post
Share on other sites

I tried test 1 and I feel it is mostly about testing how much state you can remember in short term memory than anything else.

I'm a long term alcohol abuser so mine isn't very good :-D

So, yeah I gave up altogether.

Share this post


Link to post
Share on other sites
I got three out of five in the first test, but I hated it. In the last one I kind of gave up because using std::transform with preincrements and predecrements in the operators is pure evil, so I don't care to know what it does.

Share this post


Link to post
Share on other sites

I got three out of five in the first test, but I hated it. In the last one I kind of gave up because using std::transform with preincrements and predecrements in the operators is pure evil, so I don't care to know what it does.

Frankly, a lot of the "difficulty" of these tests is down to intentional obfuscation through the use of bad naming and bad formatting. For most of them, after rewriting them to use decent names and be properly formatted, the intent becomes clear and the solutions are obvious.

 

I got all 5 right, they were easy enough once cleaned up. However, several of the questions in their quizzes rely on implementation defined behavior (as they note, although some of them might actually be undefined behavior) and so the answers are not actually correct...

Edited by Washu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this