views:

1043

answers:

8

I'm about to take a C++ test. But I only get one crack at it to get over 85%. If I don't push over that, then I don't get the job.

The problem with these tests are that they typically target generic C++, and depending on what libraries you use your definition of generic may differ. STL and Boost may seem logical to some (and should be part of most) but I worked with MFC for years before ever using templates. Why use >vector> when you've got access to CArray? (retorical question)

If you've worked with dialogs you've not used stdio. If you've worked with Borland products you've not used MFC. If you've worked with Palm, you've not used the file system, and you've definitely not used CFile.

OK, so here's the question...

Given that I'd like to pass the 85%, I'm taking online tests of "generic" C++. So... Is there a place I could go to find tests? The more the better. Correct answers are also good, either during or after the test. As long as I can learn from my mistakes.

EDIT: If your answer doesn't have a link to a test, some C++ questions, or some interview questions... You missed the point of Is there a place I could go to find tests?

Great example.. I've just found this question.
What does the following code fragment print? cout << setw(6) << setfill('#') << "Hello";
I've been coding for 9 years. And never used cout, setw or setfill once. Not since university.

+8  A: 

Erase all the MFC from your head for now. Go pick up a book like The C++ Programming Language, and try to learn the concepts front to back. You should be fine. If they are asking for more than this, I don't want to know what their definition of "generic" is.

John T
Concur -- MFC may have its uses even in this day and age, but few would hold it up as the shining example of how best to use C++.
Pontus Gagge
Didn't answer the question. Not one mention of the word TEST. Sorry mate. Also, if your company uses MFC, then you use MFC, or you find a new job. Agreed it's not the best, but best depends on a lot of variables.
baash05
You said "they specifically target generic C++". MFC != generic. Question was answered.
John T
sorry john. The question was in bold. I'm not trying to learn c++. I'm attempting to take tests to practice for an exam. Agreed mfc!= generic, But I'm not looking for a def of generic. I'm looking for tests. Your answer didn't provide a test, or links to tests, or links to inteview questions.
baash05
PS.. c++ test that has no std and mostly mfc = http://www.acuit.com/_vti_bin/shtml.dll/Test_C++.htm If that's the kind of test I get, and I'd not looked at it, I'd be screwed.
baash05
Reading a book will prepare you for an exam. My answer still stands. Just because you found one MFC test doesn't mean most C++ tests are about MFC. If you don't like my answer, vote it down. Simple as.
John T
John. Q:Where do I find a beer store? A:If you chill your glass and eat you should be prepared for beer. Q:I didn't ask how to prepare for beer. Where do I find beer? A: it's a good way to prep for the beer. Q: Where do I find beer? A: See my point.. didn't ask how to prep. Asked for tests.
baash05
vote my answer down then and stop writing stupid comments
John T
oH come on.. they're fun john. I like the comments part of this better. Chatter between us is so limited as a group. The comments bring us together. (i did vote it down).
baash05
+4  A: 

You might try Herb Sutter's book Exceptional C++; it contains items organized like questions and is, in my opinion, very clear and very well written. I don't know if it will be directly useful for the interview, but it makes you think about aspects of the language you had never considered before.

It's been a long time since I last visited it, but you might also try this site with interview questions: geekinterview.com - take a look in particular at the C++ section.

All the best for your interview :)

Paolo Tedesco
Not a big fan of the need to log on. But cool.
baash05
+1  A: 

Some questions in FAQ's might work as tests.

Zitrax
+4  A: 

The few times I've been "tested" (well "interviewed"), folks were far more concerned with questions like:

  • What is Object Oriented Programming? OOA (analysis)? OOD (design)? UML?
  • When should you inherit from a class? When should a class be aggregated?
  • What are virtual methods? What are pure virtual methods? What is the vtable?
  • Sibling cast problem. class C : public A, public B; C c; B * b = & c; How to cast object b (type B*) to an A*?
  • What does the stack look like as a simple program executes?
  • Differences between heap/stack?
  • How does new() differ from malloc()?
  • etc.

There's lots of previous discussion on C++ interviewing questions here on StackOverflow and elsewhere:

http://stackoverflow.com/questions/240212/ what-is-the-difference-between-newdelete-and-mallocfree

http://stackoverflow.com/questions/347793/ c-areas-you-look-for-during-interview

http://stackoverflow.com/questions/365823/ what-kinds-of-interview-questions-are-appropriate-for-a-c-phone-screen

http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html

Just to add my two cents here: If they are looking for graphic details... To see if you've memorized the entire C++ spec... Well I know the economy stinks right now but it is improving, there are other jobs out there, and you NEED to find one of them. Interviews are a two-way street. If they are into nit-picking details, this is NOT a place you want to work.

Mr.Ree
Excellent answer.
baash05
Thanks baash05. Means a lot!
Mr.Ree
+1  A: 

IF you are going to give tests for job then brainbench tests may help. I guess C++ tests are free and you can get some idea of what kind of questions you can get.

Good luck for tests!

Alien01
A: 

During interviews I bother about the candidate being able to show me that he/she understands what he's/she's doing and that he's/she's leaning toward "modern" C++ (i.e. template intensive).

He/she also needs to understand some subtilities of the languages, but not the most arcane. I don't ask tricky question that are based on the oddities of the language. Why?

STL mastery is a pre-requisite. I see knowing nothing about Boost as a bad sign.

If I were to write a test, I would make it quite easy just to filter the really bad programmers that don't master the syntax and the logic of C++. I however prefer a one hour one-to-one interview to filter candidates.

If you find yourself fighting against a very hard written C++ test : run away.

I hope this helps.

Edit : if you really want tests and questions, check this out : http://www.gotw.ca/gotw/

Edouard A.
Ed.. The problem is to get to the "conversation" part of the interview, I need to pass a test. Your answer's got no links to tests, or interview questions. I too prefer the 1hr 1on1. But I can't get there without 85% Got any links?
baash05
baash05
20 years of C++ experience and never heard of boost or stl? That's pretty odd! As for your 85%, I really think this is a bad sign for a recruitment process which was my main bullet point.
Edouard A.
@baash05: I find it incredibly hard to believe that someone who has been programming in C++ for that long hasn't even heard about at least the STL.
kitchen
Lack of exposure to STL/BOOST is far more common that you might think. Jobs where you are overworked (working 7 days every week, >10 hours a day, + a 3 hour commute) do not encourage learning new tools. If you are stuck with older compilers, template support is a nightmare. It happens.
Mr.Ree
Well perhaps not hearing of SLT is odd, not working with it, on the other hand. I've never met "in person" a c++ programmer who's used BOOST. I've been asking all the ones I know. SLT and BOOST are really just another set of libs. While I admit some cool fetures I seldome ever knowingly use SLT.
baash05
+1  A: 

What does the following code fragment print? cout << setw(6) << setfill('#') << "Hello";

It prints the following sentence to standard output:

Please do not work for us. We have no clue about what it means to be a good software developer.

Daniel Daranas
excellent. comment.
baash05