Design a Matchmaking Service
Design a service that pairs compatible queued players and manages the match lifecycle reliably.
Problem statement
Design a matchmaking service where a player can join or cancel a queue, the service forms compatible pairs, and both players are notified when a match is created. The design must also handle queued-player disconnects and queue-entry expiration.
The source does not define the compatibility policy or numeric traffic targets, so state any compatibility or capacity assumption explicitly.
What to build
- A player can join the matchmaking queue.
- A queued player can cancel the queue entry.
- The service can pair compatible queued players into a match.
- Both players are notified when their match is created.
- The service handles queue entries that disconnect or expire.
At scale
- No numeric traffic target is supplied; candidates should label rather than present capacity assumptions as source facts.
- A queue entry may end because it is matched, cancelled, disconnected, or expired.
- The source does not specify the compatibility rule.