Bird
Raised Fist0

In a typical Mediator interface for low-level design, which method signature correctly supports communication between components?

easy🧠 Conceptual Q3 of Q15
LLD - Behavioral Design Patterns — Part 2
In a typical Mediator interface for low-level design, which method signature correctly supports communication between components?
Anotify(event: string): void
Bnotify(sender: Component, event: string): void
Csend(message: string): string
Dupdate(sender: string, data: object): boolean
Step-by-Step Solution
Solution:
  1. Step 1: Understand Mediator role

    The Mediator coordinates communication between components, so it needs to know the sender and the event.
  2. Step 2: Analyze method signatures

    notify(sender: Component, event: string): void includes both sender and event parameters, enabling proper mediation.
  3. Final Answer:

    notify(sender: Component, event: string): void -> Option B
  4. Quick Check:

    Method must accept sender and event [OK]
Quick Trick: Mediator methods usually take sender and event parameters [OK]
Common Mistakes:
MISTAKES
  • Ignoring sender parameter
  • Using return types unnecessarily
  • Confusing method names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes