Implement a Rollback Netcode Input Buffer for a Fighting Game

Last updated: November 29, 2026

Quick Overview

Build a two-player rollback session for a deterministic fighting game: simulate each frame using the local input and a predicted remote input, and when a late remote input disagrees with the prediction, restore the saved state from that frame and resimulate to the present.

Riot Games
Software Engineering Fundamentals
Software Engineer
Riot Games
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Hard

0

0

0 solved


Build a two-player rollback session for a deterministic fighting game: simulate each frame using the local input and a predicted remote input, and when a late remote input disagrees with the prediction, restore the saved state from that frame and resimulate to the present.

Aligned with 2XKO, Riot's tag fighting game, which relies on rollback netcode. The interviewer checks that you understand determinism, saved state per frame, prediction, resimulation cost and the stall condition when one player gets too far ahead.

What the Interviewer Expects
  • Explain why the simulation must be deterministic
  • Store state and inputs per frame
  • Predict remote input by repeating the last confirmed one
  • Roll back only when the confirmed input differs from what was used
  • Resimulate from the mispredicted frame to the current frame
  • Stall when the unconfirmed window exceeds a maximum rollback
Key Topics to Cover
rollback netcode
determinism
state snapshots
prediction
game loops
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How do you keep memory bounded when matches last many minutes?
  • How do you detect a desync between the two clients?
  • What makes a game step non-deterministic in practice (floats, iteration order, random seeds)?
  • How do you hide visual and audio artifacts of a rollback from the player?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

step(state, local, remote) is pure and deterministic. advance(local) runs one frame immediately, never waiting for the network. receive_remote(f, input) may arrive several frames late. The displ...

High-Level Design

Keep three maps keyed by frame: state at the start of the frame, local input, and the remote input actually used. Prediction repeats the latest confirmed remote input at or before that frame, which is...


Submit Your Answer
Markdown supported

Related Questions