Please enable JavaScript.
Coggle requires JavaScript to display documents.
C++ interview question - Coggle Diagram
C++ interview question
C++ Core
What is encapsulation?
this means object is like a package with all data and methods, some of them hidden some not
What is polymorphism?
ability for one function act in different ways, and for classes it is ability to override parent method
-
-
What is destructor
this is like constructor only for when object is deleted, in stack auto delete, in heap (dynamic memory) manual delete
How private, public, protected access modifiers work?
-
-
-
-
-
Is it possible to overload a destructor? If no, why?
no
because destructor cannot be overloaded, it cannot have arguments
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Memory management
-
-
-
-
-
-
-
-
-
-
-
-
-
-
What is a pointer?
pointer is a type, that is point to specific memory address
What is the reference?
is just "alias" of value, acts like a pointer but it is not pointer
-
-
-
-
Can we create a pointer to the pointer? If yes, when do we need it?
-
Can we create a reference to the reference? If yes, when do we need it?
reference to rvalue, needed for move constructor
-
Can we add two pointers? If yes, when do we need it?
-
Can we subtract two pointers? If yes, when do we need it?
yes, for e.g. we can get size of array
-
What mechanisms of passing parameters to the function do you know? What is the difference
between them?
-
-
-
-
-
-
-