InterviewStack.io LogoInterviewStack.io

Game Logic Implementation Questions

Designing and implementing the code that enforces game rules and player interactions across single player and multiplayer contexts. Topics include translating design documents into efficient code architectures, implementing player movement and input handling, building character controllers, choosing between physics based and kinematic movement, using raycasting and collision detection and response, and connecting input systems to game logic. Also covers implementing game and character state machines, turn based logic and rule enforcement, handling edge cases and race conditions, ensuring determinism where required, writing testable and maintainable systems, and considering performance implications of simulation and update loops.

EasyTechnical
136 practiced
Sketch a minimal, language-agnostic input handling system that decouples raw device input (keyboard/gamepad/touch) from virtual game actions (jump, move-left). Include support for remappable bindings, input buffering (e.g., coyote time and jump buffering), and provide both an event API (onActionPressed) and a state query API (isActionDown). Show brief pseudocode for binding an input and consuming a buffered action.
MediumSystem Design
74 practiced
Explain the architecture and key components of a rollback netcode system for a fast-paced fighting game. Describe what data you snapshot each frame (inputs, minimal deterministic state), how rollback and resimulation work when a late input arrives, checksum/divergence detection, and trade-offs in snapshot frequency vs CPU and memory usage. Also discuss approaches to minimize visible correction on clients.
EasyTechnical
86 practiced
Tunneling occurs when fast-moving objects pass through colliders. List common causes of tunneling in physics simulations and describe three practical strategies to prevent tunneling in a 2D projectile-heavy game: continuous collision detection (CCD), swept collision tests (ray/sweep queries between positions), and sub-stepping (multiple smaller simulation steps). For each strategy discuss its performance and complexity trade-offs.
MediumTechnical
139 practiced
Implement 2D elastic collision response between two dynamic circles. Your function should: detect overlap, compute minimum translation vector to separate them, correct positions by inverse mass-based amounts, and compute impulse to update velocities conserving momentum with a restitution coefficient. Provide pseudocode or C++ and comment on numerical stability and penetration correction heuristics.
HardTechnical
79 practiced
Implement a high-performance single-producer single-consumer (SPSC) lock-free ring buffer (fixed capacity, preallocated) in pseudocode. Provide push and pop operations, explain how you detect full/empty states, what memory ordering semantics (acquire/release) you need, how to handle backpressure or overwrite policies, and how you'd stress-test correctness and performance under heavy producer rates (~60k events/sec).

Unlock Full Question Bank

Get access to hundreds of Game Logic Implementation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.