The interview problem
Design a server simulation that receives irregular client inputs while maintaining reproducible game-state progression.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Assume a bounded match, authoritative server state and a fixed simulation timestep. Clients send sequenced inputs; the server validates them, assigns them to accepted ticks and advances state at a controlled rate. Snapshots carry tick IDs so clients reconcile prediction. Bound input lateness and simulation catch-up work. Game logic must not trust client-reported positions or elapsed time.
2. Trace the design or derivation
Validate sequenced inputs → assign tick → simulate fixed step → publish snapshot → reconcile clients
Use a seeded random stream and versioned simulation rules for replayable matches. Record accepted inputs rather than every untrusted packet. A reconnecting client needs a recent authoritative snapshot plus subsequent inputs, while old snapshots must remain associated with the game version that produced them.
3. Calculate the example
At 20 ticks/s, each tick represents 50 ms of simulated time. A 200 ms server pause creates four ticks of backlog. Simulating all backlog plus new work can create a catch-up spiral if one tick itself takes longer than 50 ms.
4. Failure cases and trade-offs
Variable timesteps can alter physics and fairness. Unlimited catch-up destroys responsiveness; dropping time changes game semantics. Define a slowdown, bounded catch-up or match-failure policy. Deterministic replay also depends on randomness, floating-point behavior and input ordering, not only the timestep.
5. Validation, follow-ups and self-review
Replay identical inputs, inject late packets and overload tick computation. Follow-up: when is rollback feasible? Self-review: separate server authority, client prediction and bounded simulation work.
Sources and related practice
Technical reference: gafferongames.com — Fixed-step simulation and bounded catch-up work.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Assign players to matches without double booking; Design resumable browser event streams.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.