How would you design the networking for a fast-paced online multiplayer shooter?
What the interviewer wants to hear
- Authoritative dedicated server to prevent cheating
- UDP-based transport with reliability only where needed
- Client-side prediction and server reconciliation for the local player
- Snapshot interpolation for remote players
- Lag compensation for hit detection
- Bandwidth: delta compression, relevancy and tick rate
Model answer
I would use an authoritative dedicated server, because in a competitive shooter clients cannot be trusted. Transport is UDP with a reliability layer only for messages that need it, like game events. The server runs at a fixed tick rate, for example 30 to 60 Hz. Clients send inputs with sequence numbers. For the local player I use client-side prediction, so movement feels instant, and reconcile when the server state arrives by replaying unacknowledged inputs. Remote players are rendered slightly in the past with snapshot interpolation for smooth motion. For shots, the server uses lag compensation, rewinding hitboxes to what the shooter saw, within a limit. To save bandwidth I send delta-compressed snapshots and only relevant entities to each client. I would also plan for anti-cheat, matchmaking regions and testing with simulated latency and packet loss.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Game Developer questions
- Design a flexible ability and buff system for an RPG with hundreds of skills.
- How do you manage memory in a large game that ships on consoles with fixed memory?
- Explain how a modern real-time rendering pipeline draws a frame, and where the common performance costs are.
- How would you reduce cheating in an online game?
- The game averages 60 FPS but players complain about hitches every few seconds. How do you find and fix them?
- How would you build a replay system that lets players rewatch a match, and what makes it hard?
- How would you architect world streaming for a large open-world game?
- How do you use multiple CPU cores in a game without race conditions and with real speed-ups?
- How would you design the backend for an online game with matchmaking and dedicated servers?