Bird
0
0
LLDsystem_design~20 mins

Mediator pattern in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Mediator Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the role of the Mediator
In a system using the Mediator pattern, what is the primary responsibility of the Mediator component?
ATo replace all components with a single monolithic module
BTo directly manage communication between components, reducing dependencies
CTo store data persistently for all components
DTo handle user interface rendering only
Attempts:
2 left
💡 Hint
Think about how components communicate without knowing each other directly.
Architecture
intermediate
2:00remaining
Identifying components in a Mediator architecture
Which of the following best describes the components involved in a Mediator pattern architecture?
AComponents communicate only through a central Mediator object that coordinates interactions
BMultiple components communicate directly with each other without any central controller
CA single component handles all logic and no communication is needed
DComponents communicate through a shared global variable
Attempts:
2 left
💡 Hint
Focus on how communication is controlled in the pattern.
scaling
advanced
2:30remaining
Scaling challenges with the Mediator pattern
What is a common scalability challenge when using the Mediator pattern in a large system?
AThe Mediator can become a bottleneck as it handles all communication, increasing complexity
BComponents become tightly coupled to each other, making changes difficult
CThe system requires multiple Mediators to communicate directly with each other
DThe Mediator pattern eliminates the need for any communication between components
Attempts:
2 left
💡 Hint
Consider what happens when one component handles all communication in a big system.
tradeoff
advanced
2:30remaining
Tradeoffs of using the Mediator pattern
Which tradeoff is true when applying the Mediator pattern in system design?
AIt always improves performance by removing all indirect communication
BIt simplifies the Mediator but increases dependencies between components
CIt eliminates the need for any communication logic in the system
DIt reduces component dependencies but can increase the complexity of the Mediator itself
Attempts:
2 left
💡 Hint
Think about what shifts when communication is centralized.
component
expert
3:00remaining
Request flow in a Mediator pattern system
Consider a chat application using the Mediator pattern where users send messages through a central chat room mediator. Which sequence correctly describes the request flow when User A sends a message to User B?
A1,3,2,4
B2,1,3,4
C1,2,3,4
D1,4,2,3
Attempts:
2 left
💡 Hint
Follow the logical order of message sending and receiving through the mediator.