KatInterview

Designing a Commit-to-Car Release Pipeline with Graph-Based Builds

System DesignModel answer
HardModel answerSystem Designci-cdota-updatesmonorepo

Last updated

Design the path from a monorepo push to software running on customer vehicles, then explain how the build system chooses and orders the targets to build and test.

You are designing release infrastructure for an automaker. A developer pushes a change to the company's single large repository. Some time later, software containing that change is running on the onboard computers of cars owned by customers.

Part 1: Push to fleet. Describe the full journey. Cover how the change is checked and built, where outputs are kept, how a release is put together, and how it reaches and is installed on vehicles. For each stage, state what might fail and which gate prevents a faulty change from advancing.

Your answer should address:

  • Checks before merge, and a CI pipeline that yields reproducible, traceable artifacts
  • Artifact storage, signing, and provenance tying every installed binary to its originating commit
  • A staged rollout with health gates, the ability to pause, and rollback
  • Secure delivery and safe installation inside the vehicle

Part 2: What to build. The repository holds many projects, so one commit must not trigger a rebuild and retest of everything. How does the system determine which targets need building and testing for a given commit, and in what order should they run?

Your answer should address:

  • How dependencies between targets are declared and modeled
  • Finding every affected target, including indirectly affected ones
  • An ordering that honors dependencies while using parallelism and caching
  • Situations where analysis based on changed files is incorrect or unsafe

Before designing, state the clarifying questions you would ask (single image vs. per-computer components, number of hardware variants, commit volume, safety qualification needs, in-vehicle install constraints such as parked-only and power loss, and how vehicles reach the backend, including long-offline cars) and the assumptions you adopt.

Hints

Hint 1

Think of one immutable artifact that is built once and then promoted through every environment; each stage adds evidence (tests, signatures) rather than rebuilding.

Hint 2

On the vehicle, assume power can fail at any moment: use an A/B partition scheme with verification before commit and an automatic fall-back to the previous known-good slot.

Hint 3

Model the build as a directed acyclic graph of targets. Affected targets are the reverse-transitive closure of the changed targets; ordering is a topological sort with caching keyed by input hashes.

Hint 4

File-diff analysis misses changes that are not in the file graph: toolchain versions, build flags, generated code, config, data files, and dynamically loaded dependencies.