15 real OOP and Classes questions from the C++ bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What is virtual function?
Junior
A.the loss of derived-type data and behavior that occurs when a derived object is copied into a base-type variable by value
B.a member function whose call is resolved at run time based on the dynamic type of the object through the vtable
C.a marker on a derived member function asserting it replaces a base virtual, causing a compile error if no matching base signature exists
D.a destructor declared in a base class so that deleting a derived object through a base pointer correctly destroys the full object
5. Which term means: "a destructor declared in a base class so that deleting a derived object through a base pointer correctly destroys the full object"?
A.virtual destructor — a destructor declared in a base class so that deleting a derived object through a base pointer correctly destroys the full object
B.virtual destructor — a class that cannot be instantiated because it declares at least one pure virtual member, serving only as an interface or base
C.virtual destructor — a member function whose call is resolved at run time based on the dynamic type of the object through the vtable
D.virtual destructor — the loss of derived-type data and behavior that occurs when a derived object is copied into a base-type variable by value
8. Which term means: "a marker on a derived member function asserting it replaces a base virtual, causing a compile error if no matching base signature exists"?
A.override specifier — a member function whose call is resolved at run time based on the dynamic type of the object through the vtable
B.override specifier — a class that cannot be instantiated because it declares at least one pure virtual member, serving only as an interface or base
C.override specifier — a marker on a derived member function asserting it replaces a base virtual, causing a compile error if no matching base signature exists
D.override specifier — a destructor declared in a base class so that deleting a derived object through a base pointer correctly destroys the full object
11. Which term means: "a class that cannot be instantiated because it declares at least one pure virtual member, serving only as an interface or base"?
A.Abstract class — the loss of derived-type data and behavior that occurs when a derived object is copied into a base-type variable by value
B.Abstract class — a class that cannot be instantiated because it declares at least one pure virtual member, serving only as an interface or base
C.Abstract class — a destructor declared in a base class so that deleting a derived object through a base pointer correctly destroys the full object
D.Abstract class — a marker on a derived member function asserting it replaces a base virtual, causing a compile error if no matching base signature exists
A.Object slicing — a member function whose call is resolved at run time based on the dynamic type of the object through the vtable
B.Object slicing — a class that cannot be instantiated because it declares at least one pure virtual member, serving only as an interface or base
C.Object slicing — the loss of derived-type data and behavior that occurs when a derived object is copied into a base-type variable by value
D.Object slicing — a marker on a derived member function asserting it replaces a base virtual, causing a compile error if no matching base signature exists
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.