Design a Real-Time Multiplayer Game
Design a multi-region multiplayer game that matches players and runs low-latency authoritative sessions.
Problem statement
For this exercise, assume a session-based arena game where two to four players enter matchmaking, receive a regional match assignment, and exchange movement and action inputs with an authoritative game server during a roughly ten-minute match.
Design the matchmaking and live-session platform for 100,000 concurrently connected players across three active regions, with peaks of 2,000 queue joins per second.
Target a p95 matchmaking time below ten seconds once a queue has enough compatible players, run the server simulation at about 20 updates per second, and keep input-to-authoritative-state latency below 100 ms at p95 for players in a healthy assigned region.
A player may have at most one active queue entry and one live match, and every live match must have exactly one authoritative server and region.
Durable player profiles and completed-match summaries may replicate eventually across regions, but matchmaking claims and live game state require explicit correctness boundaries.
New matchmaking should fail over within 60 seconds after a region becomes unavailable; active matches lost with that region may end, and affected players may queue again. Treat gameplay rules and the skill-compatibility formula as replaceable policies.
Exclude anti-cheat, voice chat, spectators, tournaments, and in-game economy features.
What to build
- A player can join, inspect, and cancel one active matchmaking request without creating duplicate queue membership.
- The platform groups compatible players into exactly one match in a healthy region and returns authenticated connection metadata.
- Connected players can send ordered gameplay inputs and receive authoritative state updates for the duration of a live match.
- The platform durably records match lifecycle and summary outcomes and makes completed results eventually visible across regions.
At scalePractice assumption
- 100,000 players are concurrently connected across three active regions, with peak matchmaking admission of 2,000 queue joins per second.
- Once enough compatible players are available, matchmaking completes within ten seconds at p95; healthy-region input-to-authoritative-state latency stays below 100 ms at p95 while servers simulate about 20 updates per second.
- Matchmaking admission is active-active across regions and resumes within 60 seconds of a regional outage; active matches in the lost region may terminate rather than migrate live state.
- Profiles and completed-match summaries converge across regions within one minute under healthy replication, while queue claims, match assignments, and live game state use a single explicit authority.