Loading...

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
mid, senior

Problem

A CI/CD system needs to determine the correct order to build modules where some modules depend on others. Given a number of modules and a list of dependency pairs, write a function that returns a valid topological ordering. Return an empty list if a cycle is detected.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.