1.
OOP Fundamentals
- 2.
What is the difference between procedural and Object-Oriented programming?
- 3.
What is encapsulation?
- 4.
What is polymorphism? Explain overriding and overloading.
- 5.
What is inheritance? Name some types of inheritance.
- 6.
What is an abstraction? Name some abstraction techniques.
- 7.
What is a class in OOP?
- 8.
What is an object in OOP?
- 9.
How do access specifiers work and what are they typically?
- 10.
Name some ways to overload a method.
- 11.
What is cohesion in OOP?
- 12.
What is coupling in OOP?
Class Relationships and Design
- 13.
What is a constructor and how is it used?
- 14.
Describe the concept of destructor or finalizer in OOP.
- 15.
Compare inheritance vs. mixin vs. composition.
- 16.
Explain the concept of an interface and how it differs from an abstract class.
- 17.
Can a class have multiple parents in a single-inheritance system?
- 18.
How would you design a class to prevent it from being subclassed?
- 19.
Explain the ‘is-a’ vs ‘has-a’ relationship in OOP.
- 20.
Explain how aggregation relationship is represented in OOP.
- 21.
What is method overriding, and what rules apply to it?
- 22.
Describe the use of static methods and when they are appropriate.
Advanced OOP Concepts
- 23.
What is multiple inheritance and what are some of its disadvantages?
- 24.
Can you explain the ‘diamond problem’ in multiple inheritance?
- 25.
How does OOP languages support polymorphism under the hood?
- 26.
What are generics, and how can they be useful in OOP?
- 27.
Explain the concept of object composition and its benefits.
- 28.
What is Liskov Substitution Principle (LSP)? Provide some examples of violation and adherence.
- 29.
What is the dependency inversion principle?
- 30.
How can the open/closed principle guide object-oriented design?
- 31.
Describe how the Interface Segregation Principle affects system design.
- 32.
What is a mixin, and how does it differ from traditional inheritance?
Practical Use and Patterns
- 33.
How would you refactor a class that has too many responsibilities?
- 34.
Describe a singleton pattern and discuss its pros and cons.
- 35.
What is a factory method, and when should it be used?
- 36.
Explain the builder pattern and where you might apply it.
- 37.
What is the pattern, and how does it relate to OOP?
- 38.
When would you use the Adapter pattern?
- 39.
Can you explain the use of the Decorator pattern?
- 40.
Describe the Observer pattern and a scenario in which you might use it.
- 41.
What are the advantages of using the Command pattern?
- 42.
How does the Strategy pattern provide flexibility in objects?
OOP Best Practices
- 43.
What are some common OOP design anti-patterns?
- 44.
How do you ensure that your objects are properly encapsulated?
- 45.
Name some techniques for reducing coupling between classes.
- 46.
How does immutability help in object-oriented design, and how can it be implemented?
- 47.
What tools or techniques would you use to document an object-oriented design?
- 48.
How do you address circular dependencies in an OOP system?
- 49.
Explain how to apply unit testing to object-oriented code.
- 50.
What strategies can be used to safely refactor legacy object-oriented code?
- 51.
How can the principles of OOP help in achieving a modular and maintainable codebase?
- 52.
How do you balance the use of OOP principles with performance considerations in a system design?