Build fluency in the vocabulary of ordering tasks so every one appears after everything it depends on.
0 / 5 completed
1 / 5
At standup, a dev mentions ordering a set of build tasks so that every task appears after all the other tasks it depends on, using the dependency graph between them to compute that order. What is this technique called?
A topological sort is exactly this: given a directed graph of dependencies between tasks, it produces a linear ordering where every task appears after every other task it depends on, which is exactly what's needed to schedule a build, a set of package installations, or any pipeline of steps with prerequisites. A hash collision is an unrelated hash-table concept about two keys sharing a bucket. This ordering is only possible at all if the dependency graph has no cycles, since a cycle would mean two tasks each require the other to run first.
2 / 5
During a design review, the team confirms the dependency graph driving the build pipeline has no cycles, specifically so a valid topological order is guaranteed to exist for every task. Which capability does this acyclic property provide?
Confirming the graph is acyclic provides guaranteeing at least one valid execution order exists, since a topological sort is only possible when there's no cycle forcing two or more tasks to each wait on the other, which would make satisfying both dependencies simultaneously impossible. A graph containing a cycle has no valid topological order at all, since whichever task in the cycle you try to schedule first, another task in that same cycle still needs to come before it. This is exactly why a build system typically runs cycle detection before attempting to compute an execution order, so a broken circular dependency is caught early rather than silently mis-scheduled.
3 / 5
In a code review, a dev notices a dependency graph where task A depends on task B, task B depends on task C, and task C depends back on task A, forming a closed loop among the three. What does this represent?
This is a cyclic dependency, which has no valid topological order at all, since task A needs C done first, C needs B done first, and B needs A done first, so no matter which one is scheduled first, some other task in that same loop still needs to run before it. A cache eviction policy is an unrelated concept about discarded cache entries. This kind of closed dependency loop is exactly what a cycle-detection check catches before a build system even attempts to compute an ordering, since attempting a topological sort on a cyclic graph simply fails.
4 / 5
An incident report shows a build pipeline hung indefinitely because three of its tasks had been configured with a circular dependency, each waiting on another task in the same loop, and the scheduler had no way to compute a valid order among them. What practice would prevent this?
Running cycle detection on the dependency graph before attempting to schedule anything catches a circular dependency immediately and lets it be reported as a clear configuration error, rather than leaving the scheduler to hang indefinitely trying to find an order that doesn't exist. Continuing to schedule from the graph with no cycle check at all is exactly what let the circular dependency cause the indefinite hang in this incident. This upfront cycle-detection step is a standard, cheap safeguard built into essentially every real build system and task scheduler that relies on a topological sort.
5 / 5
During a PR review, a teammate asks why the team runs an explicit cycle-detection pass on the dependency graph instead of just attempting the topological sort directly and seeing whether it produces a full ordering. What is the reasoning?
A topological sort algorithm run directly on a cyclic graph can stall partway through, or in some implementations produce an incomplete ordering that silently omits the tasks caught in the cycle, rather than surfacing a clear, actionable error. An explicit cycle-detection pass instead gives a precise, immediate diagnosis of exactly which tasks are involved in the loop, which is far more useful for actually fixing a broken dependency configuration. The tradeoff is the small extra upfront cost of running a separate detection pass before scheduling, which is well worth it compared to debugging a scheduler that silently hung or misordered a set of tasks.