C++ Language-specific Questions
by Curtis Krauskopf
Language-specific questions typically test your ability
to understand why a certain rule exists in the language
rather than simply knowing that a rule exists.
Programmers who recently learned C++ using a book such
as Teach Yourself C++ in 24 Hours will have
difficulty knowing the nuances of the C++ language.
Interviewers are interested in testing candidates for
a depth of knowledge in the topic. The interviewer will
also expect you to know these topics off the top-of-your-head
because these basic facts should form the foundation
of your C++ knowledge.
-
An array is instantiated with the new[] operator.
Is it sufficient to delete the array using a delete
operator or should a delete[] operator be used?
Justify your answer.
-
Can I drop the [] when deleting an array of some
built-in type (char, int, etc)?
-
What is an example of when a destructor is NOT
called at the end of scope?
-
Explain stack unwinding.
-
When I write a derived class's destructor, do I
need to explicitly call the destructor for my base
class?
-
Explain the difference between a class and an object.
-
Explain the difference between a struct and a class.
-
What is difference between malloc/free and new/delete?
|