General Development

C++ quiz – HanClinto

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
In applying for a job, I was told that I would have to take a 90 minute C++ quiz. So even though I started in C around 18 years ago, I haven't done much with it for the past 2 years and I'm pretty rusty. I'm even *more* rusty on C++ stuff, because most of my coding experience has been in straight C. All that to say, the idea of a quiz was a little scary.

So I googled up a decent C++ quiz for me to cut my teeth on, and I didn't do too bad -- I scored 39 out of 50. It was definitely mentally stretching, but also encouraging at the same time.

Anyone else want to give it a try?

Cheers!

--clint

luke

Member

Posts: 311
From: I use your computer as my second Linux box
Registered: 10-30-2005
Yarh, I got a 32.. talk about ego bruise

------------------
If you can see Chuck Norris, He can see You.
If you Can't see Chuck Norris, you may be seconds away from death.

kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
I have never programmed in c++, got a 21, I should stick to things I know like PHP
TwoBrothersSoftware

Member

Posts: 141
From: Janesville, Wi USA`
Registered: 08-05-2006
quote:
Originally posted by kenman:
I have never programmed in c++, got a 21, I should stick to things I know like PHP


hmmm 30 - and I do prgram in C++ = although that may explain why the manula is next to my desk.

Although in my defense I spent 23-4 hours at work programming in visual basic and I don't juggle multiple languages as well as I should

spade89

Member

Posts: 561
From: houston,tx
Registered: 11-28-2006
i got 29 out of 50 questions,and 5 out of 10 questions on the memory allocations test,and 2 out of 10 on the template quiz

man,they got some tricky memory allocation questions?and i gotta study my templates.

------------------
The Truth Shall set you Free

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
haha 21. i knew very little about what they were asking. hahahaha....

------------------
that post was really cool ^
|
[|=D) <---|| me

ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
24 out of 50...
haven't touched C++ for around 4 years. maybe more.
not sure how to take that grade...

kinda makes me wanna learn C++ over again, tho.

------------------
Yes, I'm still better than you
Soterion Studios

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
35 out of 50

I thought I'd do better, honestly, but most of the questions apply to C stuff that will probably work, but you shouldn't be messing around with in C++ code. There are only a handful of C++ specific questions (except for the cout<< in so many of them). If you were actively programming DOS software in C, and knew a bit about C++, you'd blow this test away.

------------------
+---------+
|steveth45|
+---------+

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by TwoBrothersSoftware:

hmmm 30 - and I do prgram in C++ = although that may explain why the manula is next to my desk.

Nah, this is hardly the "C++ programming quiz" it's billed as. A good C++ programmer doesn't need to know what getch() does or what #include "dos.h" is going to do for you. You won't even find them in a C++ programming book.

------------------
+---------+
|steveth45|
+---------+

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
Steveth is correct. I looked at several of the questions and I would not consider them as C++. Definitely closer to C questions...and probably many in the extreme esoteric category.

Even so, these types of questions are fun to discuss, as they sometimes feel like mental brain teasers to me.

I haven't yet taken the quiz. I tried last night, but the site was proving incredibly slow, so I just left.

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
34 out of 50.

I'd love to know which ones I missed with their correct answers. Those include file questions I had to guess. I always look those up in the on-line documentation when I need to know a specific include file.

Definitely geared towards C console coding. But still fun and mentally stimulating.

I liked working through that recursive one.

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Yeah, the recursive one was a lot of fun.

What's so odd, is that I actually know what getch() does, and knew that it's not in the ANSI C standard -- it's part of the Borland libraries, in conio.h.

That was one of the early things I learned when I was 10 years old or something, because it was the only way I could find to have a non-blocking call to check to see if there was keyboard input -- so that I could have a while() loop that did a screen saver kind of thing, and then quit when the user presses a key.

I know that you're better at C++ than I am, Steveth -- I imagine that esoteric questions like that are the only reason I beat you out by a couple of answers.

SSquared -- yeah, working through the recursive question was one of my favorite parts too.

Cheers!

--clint

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
72%, 36 out of 50..

Definately not a C++ exam... I've done/seen a few from games companies and this ones far from the standard C++ exam. Also some will quiz on the C/C++ coding, as having C knowledge is good experience... depends on the company I guess...

------------------
www.auran.com

steve_ancell

Member

Posts: 37
From: Brighton, East Sussex, Southern England, United Kingdom.
Registered: 09-16-2006
I've never programmed C or C++... I got 46% 23/50.

------------------
It's nice to be important, but it's more important to be nice !

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Dartsman: I would be interested in knowing if you have any good links to a more "real" C++ exam.
Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
I've only seen a little bit of C++ code, can't write "Hello World" and a comment, and maybe a end of a line. (Confused about the line though) So pretty much a guessing game except for a little bit of logic. (99 is the last element in a 100 element array) Anyway 30% 15/50.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
"Your score is 64%. You got 32 answers correct out of a possible 50 questions."

That test was... interesting.

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
quote:

Your score is 36%. You got 18 answers correct out of a possible 50 questions.

Some of that stuff I haven't messed with since High School...sheeesh, my brain hurts!

------------------
"Bell, I have something to show you, but first, you have to close your eyes, it's a surprise." - The Beast

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
Clint, so what was the answer to that getch() question? I think I put keyboard input, but is the correct answer 'not part of the ANSI C standard'?

Hmmm, or maybe we should wait to discuss this so we don't spoil it for anyone.

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
Interesting test. I scored 42, but several of the questions are very arcane and/or stuff you would/should never do anyway - so don't feel bad if you scored lower than you thought you would. But it was a good exercise to think some of them through.

------------------
Brian

"OOP programmers have a lot of class"

Check out this webhost! Fantastic prices, features and support!

kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
You know what would be very very cool

If some of the better C++ programmers got together and wrote a CCN C++ coding quiz. One that would ROCK (I know you guys could do it!) What a way to get the word out about this great site

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Uhm.
SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
I like that idea. I have a lot of questions already from when I interview candidates, and questions my colleagues would ask. It's kinda sad though. I used to know all of the answers, but having not used some things in my current job, I have forgotten some of the answers.

My favorite questions to ask are OO, UI, and general C++ (no coding involved).

kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
Hmm average of everyone who has posted a score 27.78

I wonder if they keep long term stats on what everyone who has taken the quiz has scored

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
clint: not really sorry, if you wanna PM me your MSN account, I have some pretty tricky questions (from some other exams, paper form) which I could send you, or quiz you on MSN :P

however, here is a simple one I did up for P[N]R:
http://www.projectnresource.com/phpbb/viewtopic.php?t=176

------------------
www.auran.com

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
http://www.brainbench.com/ has many different tests, including C++.

------------------
1Jo 2:9-10 He that saith he is in the light, and hateth his brother, is in darkness even until now. 10 He that loveth his brother abideth in the light, and there is none occasion of stumbling in him.
Joh 17:26 And I have declared unto them thy name, and will declare it: that the love wherewith thou hast loved me may be in them, and I in them.

[VoHW] (Help needed) [Blog] - Truedisciple (mp3)

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Your score is 38%. You got 19 answers correct out of a possible 50 questions.

Ouch!! But then, I've only played with C/C++ for 2 1/2 weeks....

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

[This message has been edited by CPUFreak91 (edited December 12, 2006).]

D-SIPL

Moderator

Posts: 1345
From: Maesteg, Wales
Registered: 07-21-2001
34/50

------------------
"One World. One Web. One Program." -Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!" -Adolf Hitler
"I believe in freedom... not freedom like America, freedom like a shopping cart"

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
Heres another one for you Clint...

What does the keyword Mutable mean? Why would you or would you not use it?

------------------
www.auran.com

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
yeah like dartsman and BrianT said, it's all old and obscure stuff you wouldn't know unless you like created C++ haha.

man MM you make me feel bad. never really used C++ and you get 6 less than me. haha.

------------------
that post was really cool ^
|
[|=D) <---|| me

Mene-Mene

Member

Posts: 1398
From: Fort Wayne, IN, USA
Registered: 10-23-2006
It was mostly guessing work, except a few basic questions, and observations. I bet ya if i took it again, I would get another score. Although the test seemed to take forever.

------------------
MM out-
Thought travels much faster than sound, it is better to think something twice, and say it once, than to think something once, and have to say it twice.
"Frogs and Fauns! The tournament!" - Professor Winneynoodle/HanClinto

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
Dartsman, that link to your quiz on P[N]R was a really good question. I did not get it right, but felt like a goof after realizing the answer. Because when I run a debugger, I know the 'if' rule, but when I read the question I wasn't thinking of it.

I think I know the mutable answer, but am waiting for Clint to respond. I am not a fan of the mutable keyword, and have rarely seen it used. I just ran into some code the other day which could have used it.

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
ssquared: cool yeah, just a simple C++ logic question, but trips up a lot of people. It's good to write code down on paper or in notepad, just to get used to not having something help you such as IntelliSense, Visual Assist or whatever the IDE uses... Plus helps people to think about the code which they are writing and the logical structure and flow.

mutable isn't a very common keyword, I haven't seen it used much at all... But still something which a C++ coder should be aware of as it could easily confuse a coder who looks at some code which is using it. Also for in those one in a million times which you actually find it handy to use such a keyword hehe. I won't say more, as I don't wanna ruin it or anything

I'm by no means a pro or anything at this stuff (C/C++), just that I've been learning programming for a little over 5 years now, with 3 of those years with C/C++, and only really could count about 2 years out of those 3 years as being really learning and using the language (University and at work).

I wouldn't mind getting together with some other coders and producing a weekly 'test' or 'quiz'. Could do a couple of questions a week (1-10). Is it possible to setup some sort of Poll or the like so that people could do it themselves, and know the answers at the end, and how well they did? It could be pretty cool

------------------
www.auran.com

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
D'OH!
only 66% (33/50)
and i remember thinking how easy the whole thing was, there was only a couple i completely didn't know. i suck at tests

tear
*runs away sobbing*

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
I got 37 out of 50.

------------------
Sam Washburn

roor1331
Junior Member

Posts: 1
From:
Registered: 01-29-2007
Well, guys... if you thought that this was hard then check this...
http://www.softsyst.com/web_english/quiz_english.htm

P.S. for the statistics 43/50 and 45/55

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
quote:
Originally posted by jestermax:
D'OH!
only 66% (33/50)
and i remember thinking how easy the whole thing was, there was only a couple i completely didn't know. i suck at tests

tear
*runs away sobbing*


And you call yourself a programmer!

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
yeah i shouldn't have cried about it... sorry guys
Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
It's okay. *pats JesterMax on the back and hands him a tissue*