Bird
0
0

What is the main purpose of the Mediator pattern in system design?

easy🧠 Conceptual Q11 of 15
LLD - Behavioral Design Patterns — Part 2
What is the main purpose of the Mediator pattern in system design?
ATo store data persistently in a database
BTo increase direct communication between all components
CTo replace all components with a single monolithic class
DTo centralize communication between components and reduce dependencies
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of Mediator

    The Mediator pattern acts as a central hub to manage communication between components, avoiding direct links between them.
  2. Step 2: Compare options with Mediator's purpose

    To centralize communication between components and reduce dependencies correctly states the purpose: centralizing communication and reducing dependencies. Other options describe unrelated or incorrect behaviors.
  3. Final Answer:

    To centralize communication between components and reduce dependencies -> Option D
  4. Quick Check:

    Mediator centralizes communication = A [OK]
Quick Trick: Mediator centralizes communication, not direct links [OK]
Common Mistakes:
MISTAKES
  • Thinking Mediator increases direct component communication
  • Confusing Mediator with data storage patterns
  • Assuming Mediator merges components into one

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes