Practice: OOP Interview Drill
55 min · Intermediate
An OOP drill puts every topic of this module under time pressure: explain a concept with your own example, trace a polymorphism puzzle, fix a broken equality or immutable class, and sketch a small design. Speed comes from having one example ready per concept.
Topics in this lesson
- Explain-with-example round: 10 OOP questions
- Predict the output: overriding, overloading, polymorphic calls
- Fix a broken equals/hashCode and a leaky immutable class
- Design mini-question: shapes with interfaces and composition
Interview questions this lesson answers
- Drill: explain encapsulation with an example.
- Drill: explain abstraction with an example.
- Drill: explain inheritance with an example.
- Drill: explain polymorphism with an example.
- Drill: overloading vs overriding in one breath?
- Drill: can static methods be overridden?
- Drill: can private methods be overridden?
- Drill: what is a covariant return type?
- Drill: what does
instanceofgive for a null reference? - Drill: abstract class vs interface?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.