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 →
- Show Dependency Inversion with a NotificationService that currently creates EmailSender inside itself.
Define a Sender interface, have NotificationService depend on it, and pass the implementation in from outside. The service no longer knows whether it is sending email, SMS or WhatsApp.
BeginnerQuick answer1 min read