Interview Q&A / Object-Oriented Programming
Object-Oriented Programming interview questions
The four pillars, interfaces, abstract classes and design basics.
Prefer rapid revision? Practise Object-Oriented Programming short interview answers →
- How can polymorphism replace a long if-else or switch chain?
Give each case its own class with the same method, then call that method on the object. Adding a new case means adding a class, not editing the old, tested chain.
IntermediateQuick answer1 min read