← Quiz: Design Patterns: all 10 questions
Quiz: Design Patterns · Question 8 of 10
Which is a real drawback of the Singleton pattern?
Which is a real drawback of the Singleton pattern?
- A.It acts like global state, which makes unit testing and tracking dependencies harder
- B.It always uses more memory than other patterns
- C.It cannot be written in Python
- D.It allows many instances
Answer & explanation
Correct answer: It acts like global state, which makes unit testing and tracking dependencies harder
State changed in one test can leak into the next.
Can you get the rest right without peeking?
Take the timed Quiz: Design Patterns quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →