Bird
0
0

Which component typically holds the references to other components in the Mediator pattern?

easy🧠 Conceptual Q2 of 15
LLD - Behavioral Design Patterns — Part 2
Which component typically holds the references to other components in the Mediator pattern?
AEach individual component
BThe client code
CA separate observer class
DThe Mediator itself
Step-by-Step Solution
Solution:
  1. Step 1: Identify who manages communication

    The Mediator acts as a central hub and holds references to components.
  2. Step 2: Understand component roles

    Components communicate through the Mediator, not directly with each other.
  3. Final Answer:

    The Mediator itself -> Option D
  4. Quick Check:

    References holder = Mediator [OK]
Quick Trick: Mediator holds references to components it manages [OK]
Common Mistakes:
MISTAKES
  • Assuming components hold references to each other
  • Confusing observer pattern with mediator
  • Thinking client code manages references

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes