</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Online Chess System Design

The interviewer's prompt sounds like a weekend project: "Design an online chess platform. Start with two players: they find each other, play a live, timed game in the browser or on their phone, and the result counts toward their rating. Then we want to run online tournaments on it, anything from a 16-player club Swiss to an open Arena with 20,000 players."

The first version writes itself: a games table, a REST endpoint that accepts a move, and a client that polls for the opponent's reply. It works for two friends on the same Wi-Fi. Then Priya in Bengaluru plays Omar in Dubai at three minutes a side. Timed at one server in Virginia, every move she makes costs her a quarter of a second of clock time she never spent thinking, the server restarts during a deploy and the game forgets her last move after Omar has already seen it, and at 18:00 UTC twenty thousand players press "join" on the same Arena and the platform tries to create ten thousand games in one second.

The Trap Built Into a Board Game

Two failures come up again and again:

  • The Turn-Based CRUD App: treats a move as a row update and the opponent's screen as something that polls. The rules engine is fine; the clock is an afterthought, timed wherever the request happens to land. Signal: never asked whose clock it is, or what a player on the other side of the world is being charged for.
  • The Game-Engine Maximalist: reaches for a real-time game-server stack built for first-person shooters, with tick rates, client prediction and rollback. Chess has no physics and no tick: one discrete, rule-checked move every few seconds. Signal: picked machinery for the genre's reputation, not the workload's shape.

The passing answer sees what the product really is: a referee with a stopwatch. Every live game is a single-owner actor on an authoritative server that validates the move, writes it durably with one conditional write, and only then shows it to anyone. Think time is measured on one clock, at the gateway nearest the player whose turn it is, so a cross-continent game is as fair as a local one. And a tournament is treated as what it is to the infrastructure: a scheduled stampede, forecast ten minutes ahead and spread over five seconds that no player can see.

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.