Object Oriented Programming
Object Oriented Programming
2. Inheritance-Based Questions
What are the different types of inheritance in C++?
What is the difference between private, protected, and public inheritance?
What happens when a derived class has a member function with the same name as the
base class?
What is virtual inheritance? Why is it needed?
Explain the diamond problem in C++ and how it can be solved.
What happens if the base class constructor is private? Can it still be inherited?
Can a constructor be inherited in C++?
3. Polymorphism-Based Questions
What is function overloading?
What is operator overloading? Give an example.
What is function overriding? How is it different from function overloading?
What is a virtual function?
What happens if a destructor is not declared as virtual in an inheritance
hierarchy?
What is a pure virtual function?
What is an abstract class?
Can we have a pure virtual destructor? If yes, why do we need it?
----------------------------------------------------------------------------
Wrap-Up Questions
How would you explain OOP concepts to a non-technical person?
What are some real-world applications of OOP?
When should we not use OOP?
How can we make C++ code more maintainable and scalable using OOP?