How do you use multiple CPU cores in a game without race conditions and with real speed-ups?
What the interviewer wants to hear
- Use a job system with a worker pool rather than many raw threads
- Split work into data-parallel jobs over arrays of plain data
- Express dependencies between jobs instead of locks
- Main thread owns engine objects; jobs read input and write separate outputs
- Watch for false sharing, too-small jobs and sync points that stall
- Profile with a timeline to see core usage
Model answer
I avoid creating threads per feature and use a job system: a pool of worker threads, usually one per core, that runs small jobs. Good candidates are data-parallel tasks like updating thousands of particles, animation, culling, pathfinding or AI sensing, where the same code runs over arrays of plain data. Each job reads input data and writes to its own output, and ordering is expressed with job dependencies rather than locks, which keeps it free of races and deadlocks. Engine objects stay owned by the main thread, and results are applied there at a sync point. In Unity I would use the Job System with Burst and NativeArrays, whose safety checks catch races; Unreal has its task graph. I watch for jobs that are too small, false sharing on the same cache lines, and early Complete calls that stall the main thread, and confirm gains in a timeline profiler.
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?
- 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 would you design the backend for an online game with matchmaking and dedicated servers?