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 →
- What is the difference between a Service Locator and Dependency Injection?
With DI, dependencies are handed to the class from outside. With a Service Locator, the class asks a global registry for them. The locator hides what the class needs and makes testing harder.
AdvancedQuick answer1 min read