The game averages 60 FPS but players complain about hitches every few seconds. How do you find and fix them?
What the interviewer wants to hear
- Look at frame time graphs and spikes, not averages
- Profile on target hardware in a development build
- Common causes: GC, loading on the main thread, shader compilation, physics spikes, logging
- Use deep or timeline profiling around a spike: Unity Profiler, Unreal Insights, PIX
- Fix by spreading work over frames, async loading, pooling, precompiling
- Add a hitch budget and automated performance tests
Model answer
Averages hide hitches, so I look at frame time over time and find spikes, ideally on the real target hardware in a development build, since the editor behaves differently. I capture a trace with the Unity Profiler or Unreal Insights, or PIX and Razor on consoles, and inspect exactly what ran in a spike frame. Typical causes are garbage collection, synchronous asset loading or Instantiate of big prefabs, shader or PSO compilation on first use, physics with many new contacts, expensive AI path requests all in one frame, or heavy logging. The fixes depend on the cause: pool objects and remove per-frame allocations, load asynchronously and preload ahead of time, precompile shaders, time-slice AI and pathfinding across frames. Afterwards I add an automated run that records frame times and fails if a hitch above budget appears.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Game Developer questions
- How would you design the networking for a fast-paced online multiplayer shooter?
- 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?
- 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?