Scenario
Design a real-time online chess game service.
Core requirements
-
Users can
challenge friends
and start a game session.
-
Two players take turns making moves.
-
A player may
undo (take back) moves only until the opponent makes their next move
.
-
Interpreting this strictly: after you make a move, you can retract it as long as the opponent has not responded with their move yet.
-
Provide a
leaderboard
that can show
all users’ rankings by score at any time
.
Non-functional requirements (clarify assumptions)
-
Support many concurrent games.
-
Low-latency move delivery (near real time).
-
Correctness: legal move validation, turn ordering, no double moves.
-
Basic reliability and auditability (game history, dispute resolution).
Out of scope (unless you choose to include)
-
Anti-cheat engine detection, spectating, chat, tournaments, puzzles.