Design Multiplayer Matchmaking
Understanding the Problem
🎮 What is matchmaking? Matchmaking is the service that takes players who pressed "Find Match" and groups them into games. In a team shooter, that means picking 12 people of similar skill who all have a good connection to the same data center, splitting them into two fair teams of six, and giving them a game server to play on. In a battle royale, it means filling a 100-player lobby fast enough that nobody gets bored waiting.
Interviewers ask this in a few forms: "design matchmaking for a 6v6 game," "skill-based matchmaking for 1M concurrent players," or "fill 100-player lobbies for a battle royale." These are the same problem with different knobs. A 12-player match cares a lot about skill balance and can afford to wait a little; a 100-player lobby cares mostly about filling quickly and treats skill loosely. We'll design the 12-player case as the main path and cover the 100-player lobby as a deep dive.
Functional Requirements
Agree with your interviewer on what's in scope. Matchmaking sits between the game client, the social systems (friends, parties) and the game servers, so be clear about where it starts and stops.
Core Requirements
- Players, alone or in a party, should be able to join the matchmaking queue for a game mode, and cancel.
- The system should form matches of the right size (12 players in two teams of 6) with players of similar skill and good latency to a common region.
- Players should be notified when a match is found, accept it, and be connected to a game server.
- Players' skill ratings should update after each match, so future matches stay fair.
Below the line (out of scope)
- The game server simulation itself (netcode, physics, hit registration).
- Friends lists and party invites. We'll assume a Party Service exists and tells us who is in a party.
- Anti-cheat and smurf detection beyond a mention.
- Backfilling a player into a match already in progress (we'll touch on it at the end).
Non-Functional Requirements
Ask your interviewer for the scale and what "good" means. Queue time and match quality pull in opposite directions, so get a target for each. For our design: 1M concurrent players at peak across six regions.
Core Requirements
- The system should find a match in under 30 seconds at p50 and under 2 minutes at p95, for all but the very highest and lowest skill levels.
- Matches should be fair: both teams should have close to a 50% predicted chance of winning, and players should rarely be matched far outside their skill.
- All players in a match should have acceptable latency to the game server (for example under 80 ms ping).
- A player must never be placed in two matches at once, and a match must never start with a missing or duplicate player.
- The system should absorb spikes, such as a new season launching at 3x normal traffic, without falling over.
Below the line (out of scope)
- Cross-region matches where players on two continents play together.
- Long-term analytics on match quality (we'll emit the data, not build the dashboards).
The back-of-the-envelope here is surprising. Say a 6v6 match lasts about 10 minutes, and between queueing, loading and the post-game screen, a player cycles every 11 minutes or so. Then 1M players enter the queue at about 1M / 660 s ≈ 1,500 tickets per second, which produces about 125 matches per second, and roughly 83,000 matches are running at any moment (1M / 12).
Now use Little's law for the queue: if tickets arrive at 1,500 per second and wait 30 seconds on average, only about 45,000 players are waiting at any time. Split by six regions and four game modes, that's under 2,000 per pool.
The insight to say out loud: matchmaking isn't a throughput problem. 1,500 tickets per second and a few thousand players per pool fit in one process's memory. The hard parts are the matching algorithm (quality vs. wait time), keeping pools big enough to match well, never double-booking a player, and getting game servers ready fast enough.