views:

1160

answers:

8

I have a Phone interview coming up next with with a company which works in financial software industry. The interview is mainly going to be in C++ and problem solving and logic. Please tell me the method of preparation for this interview. I have started skimming through Thinking in C++ and brushing up the concepts. Is there any other way I can prepare?? Please help.

Edit:

Thank you all everyone for the advice. I just want to add that I am currently fresh out of grad school and have no previous experience. So Can you suggest some type of questions that will be asked to new grads??

+16  A: 

Make sure you know your basic data structures and algorithms. You're more likely to be asked about that stuff than something higher up the food chain. Those are usually saved for the in-person interview.

Put another way: be solid with the fundamentals and solid with your C++ syntax. Also, knowledge of common libraries like STL and Boost couldn't hurt...but be sure you know what those libraries give you! In the end phone screens are there to cull out people who can't do the basics. Prove you can and you should move on to the next step. Good luck!

Here's some links of interview questions to check out:

Now, for completion's sake, some books:

Kyle Walsh
Also check out this blog post on keeping C++ declarations straight, just in case they try and trip you up with those: http://binglongx.spaces.live.com/blog/cns!142CBF6D49079DE8!273.entry
Kyle Walsh
+1  A: 

Besides the obvious parts of the language, I've found that employers will want to see if you fully understand pointers, references, how copy-constructors come into everything, probably STL, and of course the basics of classes.

Smashery
+3  A: 
  • Try some practice problems on TopCoder.

  • Check out Marshall Cline's C++ FAQ. Its a good way to learn some new stuff and bone up on the things you already know in case the decide to ask you some 'knowledge' questions as opposed to 'problem solving' questions.

theycallmemorty
+1 for the FAQ. Def worth a second (or first, if that's your case) read before an interview!
Kyle Walsh
A: 

Read (or skim, depending on how much time you have to prepare) "Large-Scale C++ Software Design" by John Lakos. Chances are, you will need it.

Max A.
+12  A: 

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.

Matt
+1 because I learned a few things. Thanks!
John at CashCommons
Just out of curiosity... why would you prefer `boost::shared_ptr` over `std::auto_ptr` without more information? I would be much happier with a candidate that responded with _"it depends on what is in [do some stuff]"_ myself.
D.Shawley
Indeed. If the `auto_ptr` would do but you wanted to avoid its pitfalls, one would use `boost::scoped_ptr` (or `std::tr1::unique_ptr`).
UncleBens
std::auto_ptr is not copyable - if you try to pass it by value to another function, that function will _take ownership_ of the pointee and, since arguments go out of scope at the end of the function call, free it then. Probably not what you had in mind. This is because auto_ptr only takes a pointer in new and guarantees deletion when out of scope.Boost's shared_ptr can be copied, as it maintains an internal reference count, so passing it by value into a function does "what you expect" by incrementing the reference count. Only when the count goes to 0 does it free the pointee.
Matt
This is also why the scoped ptr is great - it can't be copied, period. While the auto_ptr has "transfer of ownership" copy semantics, scoped_ptr has "this code doesn't compile" copy semantics. Much harder to use unintuitively. Kudos to UncleBens for that.
Matt
+1  A: 

Grab a knowledgeable friend and have them ask you some C++ programming problems that you can solve on a whiteboard. A lot of interviews will have you solve a problem on a whiteboard, and it can be disconcerting to think on your feet and write things out in front of someone if you are not used to it.

Pedro Estrada
+1  A: 

Even if they're interviewing for a C++ position not all questions may be specific to C++. For example, I've been hit with questions related to the following all in the same set of interviews for a single C++ position:

  • Algorithmic complexity of well known sort and search algorithms
  • Multithreaded programming
  • Multiprocess programming
  • Sockets programming
  • Software development philosophy / approach
  • Software test and validation philosophy / approach
  • Debugging
  • Benchmarking
  • Dynamic and static analysis of code (e.g. run-time memory leak detection vs compile-time)

In my case, the phone interview was part of a screening process to determine if I could take an online C/C++ knowledge test (e.g. through BrainBench). The online test results then determined if I would be flown out for on-site interviews, which also included more "hands-on" software development tests.

YMMV. A lot depends on what you claim on your resume, as well.

Interviewers often try to help you by giving you hints so that they can see if you can arrive at the answer they're looking for. Besides gauging your knowledge, they also want to see how you think. Occassionally you might get a crummy interviewer that is neither helpful nor positive. The key is to be confident in your abilities and be truthful.

HTH and good luck!

Void
+1  A: 

Something which I am starting to believe is that there is sometimes a clear divide between candidates that enjoy programming as a hobby versus those who consider it "just a day job".

Even if you don't know the answer to a specific question it is worth mentioning that normally you'd look up the answer on < your favourite resource > (eg. StackOverflow).

Based on your experience I don't think the interviewer will expect that you'll get every question right. They're most likely trying to decide if you've got "potential".

So relax and try to enjoy it!

Richard Corden