I have an interview for a C++ internship position. Now, the thing is I've taken two out of three quarters of the basic CS classes (in C++) at my community college and we covered the basics up to arrays, pointers, linked lists, recursion, etc (basically all of Walter Savitch's Absolute C++ book).

I spoke to the interviewer on the phone and he said the interview will include technical questions on trees, hashes, probably some sorting algorithms, and other stuff like that. I have less than a week to prep for the interview.

What can I do to familiarize myself with the absolute, bare, essentials of the aforementioned interview question topics?

Or, is it just a waste of time for me until I take the next class that covers all of those things?

  • Have you covered objects and classes yet? – Ivan Jan 6 '12 at 20:06
  • Yeah, I'm pretty comfortable with OOP. – sq1020 Jan 6 '12 at 20:07

You could try to get the material for the class about algorithms and data structures. There is a lot of theory behind those things, but I don't think they'll ask you in depth about that for an internship, so you don't have to really get behind the material, but it helps to have read at least the introductions for popular algorithms and to know what they do.

You probably should know how Bubble Sort, Merge Sort and Quick Sort work (they're a popular selection of sorting algorithms, though there are many more). Maybe the Wikipedia articles on those are sufficient to get the algorithm. You should also implement them. It's not that difficult, and it will greatly help you to understand the algorithms. Same thing with trees and Hashmaps/Hashtables, try to understand the concepts and implement them. Linked Lists belong in that category as well as a typical data structure. Graph algorithms are interesting as well and would most likely be covered in the material for the corresponding graph, but sorting and data structures probably takes precedence.

The interview itself is not going to be a waste of time. It's going to give you experience, no matter how it works out. And unless you abuse the interviewer or something like that, a failure will most likely also not burn bridges at the company - you're a student and improving, so you can always reapply under the premise that you have worked hard and are much better equipped then.

  • 1
    +1 for the technical info, but also for "It's going to give you experience, no matter how it works out"! – msanford Jan 6 '12 at 21:43
  • 1
    Bubblesort is a matter of intellectual curiosity only, being inferior in pretty much every way to insertion sort. I'd recommend learning insertion sort instead of bubble sort and heap sort instead of merge sort. – David Thornley Jan 6 '12 at 22:49

However much you learn during the next week, make sure to be honest to your interviewer. Since it's an internship for a student, they won't be too harsh. If you can't answer a question he is asking about stuff you didn't study yet, tell him so. But be prepared to also tell him what you do know and what you are good at.

Apart from that, I also think that it will be a good experience for you regardless of the outcome. The worst that can happen to you is that they don't accept you. Then you'll at least know what to expect at your next interview.

  • 1
    Probably the worst thing the OP could do would be to pretend to know a lot more than he does. – David Thornley Jan 6 '12 at 22:50

basics up to arrays, pointers,

Arrays and pointers are not the basics of C++. std::vector<T> and std::string is the basics of C++. If you don't know and use the C++ Standard Library extensively and as an exclusive replacement of C arrays, and mostly raw pointers too, (except in some very niche cases) then you don't qualify as a basic C++ user. And if you find yourself dealing with T[] or array-to-pointer decay, then you've done it wrong in all scenarios.

  • 4
    While your point for sure is valid, I think the answer is a bit harsh since OP is obviously a beginner. In my opinion it's more important for beginners to be able to deliver working - but not necessarily good - code. – mort Jan 6 '12 at 20:45
  • @mort: That's going to be much easier and more likely using the Standard Library than arrays an pointers. – DeadMG Jan 6 '12 at 21:45
  • One important thing: arrays and pointers are integral features of C++. Standard library is written using such features. So one needs to understand the basic feature first before jumping directly to std library. – iammilind Jan 7 '12 at 8:26
  • @DeadMG: True again, BUT: OP is a beginner - what help is it telling a beginner that he's not a C++ master? If the company wants someone that knows about that stuff, they shouldn't be interviewing a student that just attended beginner's classes. – mort Jan 7 '12 at 10:59
  • Agree with DeadMG here. I wouldn't mind at all if an intern was unable to reimplement std::map, but did knew how to use it. – MSalters Jan 9 '12 at 13:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.