Challenge 2: Draw a Dependency Graph — Possible Solution ==================================================================== GIVEN JOBS ----------- - build (no dependencies) - unit-tests (depends on build) - integration-tests (depends on build) - deploy (depends on both unit-tests AND integration-tests) WHAT RUNS WHEN ------------------ 1. build runs FIRST and alone — nothing else can start until it completes, since both test jobs depend on it. 2. Once build finishes successfully, unit-tests and integration-tests BOTH become eligible to start, and run IN PARALLEL with each other — neither depends on the other, only on build having already finished. This mirrors this chapter's own example exactly: "lint — depends only on build; runs in parallel with test," just with two differently-named test jobs instead of a lint+test pair. 3. deploy cannot start until BOTH unit-tests AND integration-tests have finished successfully — it has two dependencies, not one, so it waits for whichever of the two parallel jobs takes LONGER to finish before it can begin. If unit-tests takes 2 minutes and integration-tests takes 5 minutes, deploy waits the full 5 minutes (plus build's time), not just 2. WHY THIS WORKS AS AN ANSWER ------------------------------ This is a direct extension of the chapter's own build → [lint, test] → deploy example, with two parallel branches (unit-tests and integration-tests) instead of the example's two (lint and test) — the underlying graph SHAPE is identical, just relabeled. The key insight this chapter emphasizes is that "the pipeline finishes in whichever [parallel job] takes longer, not the sum of both" — running unit-tests and integration-tests in parallel here saves real time compared to running them one after another, but deploy's start time is still gated by the SLOWER of the two, not the faster one, since it depends on both completing.