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 does an IoC container do, and when is it worth using?
It creates objects, works out their dependencies and injects them for you, often also controlling their lifetime. It saves manual wiring in large applications, but is unnecessary in small ones.
IntermediateQuick answer1 min read - What is the difference between the Observer pattern and Publish-Subscribe?
In Observer, observers register directly with the subject and the subject calls them. In Pub-Sub, a message broker sits between publishers and subscribers, so neither knows the other.
IntermediateQuick answer1 min read