Preparing your design workspace

Loading the problem and your latest saved attempt…

CI/CD Pipeline Orchestration System

Design a multi-tenant CI/CD control plane that safely orchestrates dependency-aware pipeline runs across regional data-plane worker fleets and stays fair and predictable when ready work outruns worker supply.

Problem statement

For this exercise, assume engineering teams define versioned CI/CD pipelines as directed acyclic graphs of build, test, and deployment steps. A repository event or manual request creates a run from one immutable definition and source revision.

A globally reachable control plane owns pipeline and run state, admission, placement, and audit, while regional data planes own isolated worker fleets, execution leases, log shipping, and artifact transfer.

Ready steps execute in an eligible region subject to tenant quotas, declared resource needs, data residency, and regional capacity; dependent steps unlock only after required predecessors succeed. Users can inspect status and logs, cancel a run, and retry eligible failures.

The orchestrator may deliver work at least once, but one logical step attempt must not produce duplicate authoritative completion or an unintended second deployment.

For this exercise, also assume that at peak, ready work can exceed the workers available in a resource class, most of all in GPU pools, which are scarce and slow to grow: waiting work must stay visible, priority and preemption rules must be explicit, capacity may grow only within a budget, and superseded work should not compete for workers.

Design the control-plane/data-plane boundary, regional host distribution, scheduler, state machine, worker protocol, artifact and log flow, fairness, peak-capacity handling, and failure recovery. Exclude source-control hosting, compiler internals, and implementation of deployment targets.

What to build

  1. A team can publish an immutable versioned pipeline DAG and idempotently trigger a run for a source revision.
  2. The service schedules ready steps onto compatible isolated workers while enforcing dependency, quota, and cancellation rules.
  3. A user can inspect run, attempt, log, and artifact state and can cancel or retry according to explicit terminal and uncertain outcomes.
  4. The control plane places ready steps onto eligible regional data-plane fleets and safely rehomes unstarted work when capacity or a region becomes unavailable.
  5. When ready work exceeds the available workers of a resource class, the service keeps it queued and visible, orders it by priority and fair share, grows capacity within a budget, and drops superseded work so the backlog stays bounded.

At scale

  • Assume 100,000 active pipelines, 1 million runs per day, and 50,000 concurrently executing step attempts at peak.
  • Target p95 ready-to-dispatch delay below 5 seconds when a tenant is within quota, while preventing one tenant from starving others.
  • Retain run metadata and logs for 90 days and immutable release artifacts for one year.
  • Workers, queues, and schedulers may fail or partition; orchestration state must survive a zone failure and converge after duplicated or late events.
  • For this exercise, assume three active execution regions; a control-plane partition must stop unsafe new assignments in an isolated data plane while already leased work follows explicit completion and reconciliation rules.
  • For this exercise, assume that at weekday peaks ready GPU work can arrive at about three times the rate the GPU pool can start it, new CPU workers take about one minute and new GPU workers about ten minutes to become ready, and each pool may grow to at most twice its baseline size within the budget.