Walk me through a CI/CD pipeline you built from scratch. What were the stages?
For this coding exercise, model the stages as a dependency graph and return the lexicographically smallest valid execution order. Return an empty list when dependencies contain a cycle.
Input: stages, a list of unique integers, and dependencies, pairs [prerequisite, stage]. Output: a list containing every stage exactly once, or [] if no valid order exists.
def order_pipeline(stages, dependencies):