Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Online Chess Platform

Design matchmaking, authoritative game sessions, routing, and chess-clock timeout behavior for an online chess service that can grow from a new product.

Problem statement

For this exercise, assume an authenticated player can join one matchmaking queue, be paired with one compatible opponent, and play one turn-based online chess game. A replaceable compatibility policy uses broad rating and region inputs.

Matched players receive authenticated routing information for one authoritative game session; that session accepts at most one legal move for the expected game version and turn, then publishes the next versioned board state. Players can reconnect and recover the latest authoritative snapshot plus subsequent moves.

Completion publishes one stable competition result and applies one idempotent rating change per player; a replayed result or stale rating writer must not double-apply or overwrite a newer rating version. Each player begins with a ten-minute clock.

The server computes remaining time from monotonic deadlines, and once timeout commits, a later move from the expired player cannot revive the game.

Plan initially for 20,000 concurrent games and 500 queue joins per second, but explain how the design evolves by an order of magnitude because demand for this new product is uncertain.

When an eligible opponent is already queued, target p95 matchmaking below five seconds; in a healthy assigned region, acknowledge an accepted move within 250 ms at p95. A player may have at most one active queue entry and one active game, and each game has exactly one authoritative session owner at a time.

Assume chess-rule validation is available as a deterministic library. Exclude engines, anti-cheat, chat, spectators, tournaments, and payments.

What to build

  1. A player can join, inspect, and cancel one active queue entry, and compatible queued players are assigned to exactly one game.
  2. Both matched players receive authenticated routing information and can connect to the one authoritative session for their game.
  3. Players can submit legal moves in turn and receive ordered, versioned authoritative board-state updates.
  4. A reconnecting player can recover current game and clock state, and the platform records a terminal result including a server-authoritative timeout.

At scalePractice assumption

  • Launch planning supports 20,000 concurrent games and 500 queue joins per second, with an explicit path to ten times that demand if the initial forecast is wrong.
  • When an eligible opponent is already queued, matchmaking finishes within five seconds at p95.
  • In a healthy assigned region, an accepted move is acknowledged by the authoritative session within 250 ms at p95.