Design a real-time multiplayer typing race game
Company: OpenAI
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a real-time multiplayer typing game. The report describes it as a variant of the common "design online chess" question. In its usual form, players are matched into a race, all type the same passage at the same time, see every opponent's progress live while they type, and get a ranking when the race ends.
```hint Who is trusted with the result
Clients can be modified and their clocks disagree. Decide which component is trusted to say how far each player has typed and who finished first.
```
```hint Count the messages
Estimate how many messages a single race would generate if every keystroke were sent to every opponent, and decide whether opponents need that level of detail.
```
### Constraints and Clarifications
- Not given: players per race, concurrent players, how matching works, how results are scored, and whether ratings, leaderboards or anti-cheat are in scope. Ask, or state your assumptions.
### Clarifying Questions
- How many players per race, and how are they matched: by skill, with friends in a private room, or both?
- How many players are online at peak, and in which regions?
- How quickly must a player see an opponent's progress?
- How is a result computed: finishing order, words per minute, accuracy? Must a typo be corrected before the player can continue?
- What happens when a player disconnects mid-race: can they rejoin, and does the race wait?
- Are ratings, leaderboards, race history, spectators and anti-cheat in scope?
### What a Strong Answer Covers
- Scope and estimates: concurrent races, messages per second, connection counts
- Matchmaking and a race lifecycle (lobby, countdown, race, results) with a single owner for each race's state
- Real-time transport, the progress update rate and fan-out within a race, and a synchronized start
- Server authority: validating input against the passage and deciding finishing times fairly across players with different latencies
- Disconnects and reconnects, game-server failure mid-race, and durable results
- Anti-cheat, ratings and leaderboards, scaling across regions, and observability
### Follow-up Questions
- A player's connection drops for five seconds mid-race. What do they and their opponents see?
- How would you detect a bot that types at an implausibly steady speed?
- A game server hosting hundreds of live races crashes. What happens to those races?
- How would you let thousands of spectators watch a popular race live?
Overview: A system design question asking you to design a real-time multiplayer typing race, a variant of the online chess design: match players, run synchronized races in which everyone sees opponents' progress live, and rank the results. It tests real-time transport, server authority, race state ownership, reconnects, anti-cheat and scaling.
Read the full OpenAI Software Engineer interview experience this question came from