Order Asset Loading From Experience Package Dependencies

Last updated: November 29, 2026

Quick Overview

Given the assets in a Roblox experience and dependency pairs (asset requires another asset to load first), return a load order that is lexicographically smallest among valid orders, or report the assets stuck in a dependency cycle.

Roblox
Coding & Algorithms
Software Engineer
Roblox
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Given the assets in a Roblox experience and dependency pairs (asset requires another asset to load first), return a load order that is lexicographically smallest among valid orders, or report the assets stuck in a dependency cycle.

Fits an onsite coding round for engine or creator tools teams, where packages, meshes and textures reference each other. The interviewer checks Kahn's algorithm, deterministic tie-breaking, cycle detection with a useful error, and input validation.

What the Interviewer Expects
  • Build in-degree counts and adjacency from dependency pairs
  • Use Kahn's algorithm with a min-heap for deterministic order
  • Detect cycles when not all nodes are emitted
  • Report which assets are involved in or blocked by the cycle
  • Validate unknown asset references
Key Topics to Cover
topological sort
Kahn's algorithm
heaps
cycle detection
dependency graphs
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you load independent assets in parallel batches and minimize total load time?
  • How would you report the exact cycle path rather than every blocked asset?
  • What changes if dependencies can be added incrementally while the game is running?
  • How would you handle optional dependencies that can be skipped?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: a list of asset names and pairs (asset, requires). Output: an order where every requirement appears before the asset that needs it, choosing the alphabetically smallest ready asset at each st...

High-Level Design

Model assets as nodes and add an edge requires -> asset. Kahn's algorithm repeatedly removes a node with in-degree zero. Using a min-heap as the ready set instead of a queue gives the lexicographica...


Submit Your Answer
Markdown supported

Related Questions