programming might be 25% of my job. C++ is one portion of this and I need to
pick it up after several years of experiences in other stuff. What's wrong
with cramming and what's wrong with asking for help on cramming more
efficiently? As a colleage student, how much real-world C++ programming
experiences do I have aside from several classes at various stage of my
schooling? Don't waste other people's bandwidth and time if you don't
intend to help.-
When I was a student I found that there were some subjects I really
knew and I didn't really need to apply any special techniques at all to
answer the examinations, I could just answer them from my knowledge
whatever they were likely to ask and pass easily with an A grade. It
was only in those when I didn't really know the subject properly that I
had to apply some "technique" - planned answers for what they were
likely to ask - and then I most often got only a B grade.
A good interviewer (as well as a good examination paper in my opinion)
will test the full range so there will be some easy questions, some
medium questions and some real testers so they can find your true
level. They might not expect you to know everything.
In my opinion it should generally be based on understanding techniques,
not necessarily knowing the technical names for them, but unfortunately
that's not always the way it is, so my advice is to at least ensure you
do know the technical names for the techniques you understand.
Know what these terms mean:
- Inheritance
- Overriding
- Overloading
- Polymorphism
- Encapsulation.
You might even add a comment, eg if asked what encapsulation means, you
might say that it technically means wrapping in a shell, and
technically is used to protect the user of a class from its
implementation detail. You might say that this is often done with
private members but ideally it is done in a manner whereby the users of
the class cannot see any implementation detail at all. You might
mention the pImpl idiom.
You might get asked about design patterns too. These are questions that
have annoyed me a lot because I have used them without knowing the
technical names for them. I don't know of a good site that gives a
quick, clear explanation of them, and possibly a very simple example in
C++. Perhaps I should write my own.
You might get asked some questions about the language.
- What is the difference between a struct and a class? Commonly asked
question. Remember to state that technically the only difference is
that by default, access in a struct is public and in a class is
private, and that by default a struct inherits publically and a class
privately. You may however want to point out that although this is the
only technical difference, because one tends to associate a struct with
C, the struct keyword is most often used only for basic aggregates of
data.
- What is the difference between a pointer and a reference? References
use a different syntax, must be initialised to refer to a single object
and must then refer to the same object throughout their lifetime. A
pointer need not be initialised, may point to NULL and may later point
to a different object - and they use a different syntax.
- What is the difference between a macro and a 1. template 2. inline
function. I'll leave you to answer those.