Skip to content
RED SAGSkills
mediumGame Developer interview question

How would you procedurally generate dungeon levels that are always playable?

What the interviewer wants to hear

  • Choose an approach: rooms and corridors, BSP, cellular automata, or handmade room templates
  • Use a seeded random generator for reproducibility
  • Guarantee connectivity with a graph or spanning tree and validate with pathfinding
  • Place start, exit, keys and loot using rules and distance
  • Mix authored pieces for quality and test many seeds automatically

Model answer

I usually combine authored room templates with a procedural layout, because pure randomness often looks messy. The generator uses a seeded random number generator so any level can be reproduced from its seed for bug reports or sharing. I place rooms with a method such as BSP splitting or random placement with overlap checks, then build a graph of rooms and connect them with a minimum spanning tree plus a few extra edges for loops. That guarantees every room is reachable. Then I place the start, the exit as the farthest room, and keys before their locked doors by walking the graph. Finally, a validation step runs pathfinding from start to exit and rejects bad seeds, and an automated test generates thousands of seeds to catch rare failures.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Game Developer questions