Mid
From PDF
GoF Patterns
Gang of Four Patterns
Difficulty in Extending:?
Short answer: The Singleton Pattern makes it harder to extend or inherit the class due to its static nature.
Explain a bit more
Conclusion: The Singleton Pattern is a powerful tool for ensuring that a class has only one instance and provides a global access point to that instance.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png