Your game runs at 40 FPS but must hit 60 FPS. How do you find and fix the problem?
What the interviewer wants to hear
- Profile on target hardware, in a development or release build
- Find whether it is CPU-bound or GPU-bound
- CPU: scripts, physics, GC, draw call submission
- GPU: overdraw, shaders, resolution, shadows, post-processing
- Fix the biggest cost first and measure again
Model answer
At 60 FPS I have about 16.6 ms per frame, so I first profile on the target device using the Unity Profiler or Unreal Insights, not just the editor. The first question is whether the CPU or the GPU is the bottleneck, which I can see from frame timings or by lowering resolution and seeing if FPS improves. If it is CPU-bound, I look at expensive scripts, physics, garbage collection spikes and too many draw calls, and fix them with caching, pooling, batching or instancing. If it is GPU-bound, I check overdraw, heavy shaders, shadow cascades, post-processing and resolution, and use LODs, occlusion culling and simpler materials. I always fix the largest item first, measure again, and set budgets so the problem does not return.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Game Developer questions
- How would you design a save game system?
- How would you build the AI for an enemy guard that patrols, notices the player, chases and attacks?
- How would you choose between Unity, Unreal and Godot for a new project?
- How do you make game systems easy for designers to tune without changing code?
- How would you build a third-person camera that follows the player smoothly and does not clip through walls?
- Players report that their character sometimes falls through the floor. How do you investigate and fix it?
- How would you design input handling that supports keyboard, gamepad and touch, plus key rebinding?
- How would you procedurally generate dungeon levels that are always playable?
- Describe how you would design a reusable object pool and what trade-offs it has.