The Build Order
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given n modules (0..n-1) and a list of [a, b] edges meaning a depends on b (b must be built before a), return a valid topological build order. Return [] if a cycle exists.
Summary
Some tasks must wait for others to finish first.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.