← Quiz: Observer, Strategy and Decorator: all 10 questions
Quiz: Observer, Strategy and Decorator · Question 7 of 10
With 3 optional coffee add-ons, how many subclasses would you need to cover every combination (including plain coffee)…
With 3 optional coffee add-ons, how many subclasses would you need to cover every combination (including plain coffee) without Decorator?
- A.3
- B.4
- C.6
- D.8
Answer & explanation
Correct answer: 8
Each add-on is either present or not: 2 × 2 × 2 = 8 combinations.
Can you get the rest right without peeking?
Take the timed Quiz: Observer, Strategy and Decorator quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →