Skip to content
Tech Interview Prep
Technical interview guide

CI/CD Pipeline Design

Continuous integration and continuous delivery: automating the path from commit to a shippable build.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: GitHub Actions, GitLab CI/CD, NIST SSDF, SLSA v1.2, Sigstore, OCI, Kubernetes, Argo CD, and DORA guidance current 2026-08-31.

Overview

Curated: · Written: · Reviewed:

CI/CD Pipeline Design

In one line

CI/CD automates the path from a commit to a tested, digest-identified artifact and, where policy allows, its release. Reach for it when every change must be integrated and tested the same way, and every production release must trace back to one immutable artifact.

Key definitions

  • Digest: the sha256 of the image manifest. It is the artifact's identity. Tags are mutable pointers to it.
  • Build once, promote: one build per commit. The same digest moves through staging and production, and environment config is injected at deploy time.
  • Continuous delivery: every passing change yields a deployable artifact. A person decides when to release.
  • Continuous deployment: passing changes release automatically. The pipeline's evidence is the release authority.
  • Expand/migrate/contract: the three-step schema change that keeps old and new code compatible during a rollout.
  • Chain of custody: the recorded link from source revision to digest to signed provenance to running pods.

How it works

A pull request builds against the merge ref, the PR merged into the current base, so a green PR can still break main once a second PR lands. Stages form a DAG through needs:, so fast checks fail first. The build pushes an image and emits its digest. Attestation binds that digest to the commit and build inputs. Deploy pulls by digest, never by tag. Readiness gates traffic, and smoke tests plus SLO checks verify from the user boundary.

PR merge ref Fast checks Integration tests Build and push digest Attest and sign digest Deploy staging by digest Smoke tests and SLO check Promote same digest to prod

When to use and when not to

SituationChoiceWhy
Shared service, several deploys a dayFull pipeline: DAG, digest promotion, progressive rolloutIntegration risk stays small and rollback has evidence behind it
One deploy a week, no real test suiteBuild script that records the digest, manual deployStages you do not run add ceremony without signal
Regulation requires human sign-offContinuous delivery with a gated, auditable releaseContinuous deployment is off the table by policy
No detection in production yetFix observability firstAutomation without detection only widens blast radius
Monorepo at thousands of PRs a daySelective testing, remote cache, merge queueRunning everything per PR stops fitting in a merge gate

Traps interviewers probe

  1. Rebuilding per environment. Staging and production then run different bytes for the same commit. Fix: build once, promote the digest, inject config at deploy time.
  2. Deploying a tag. :stable can be overwritten, so the release record names a tag that no longer means what it did. Fix: reference the digest in manifests, and make the registry reject tag overwrites.
  3. Interpolating untrusted context into run:. A PR title in echo "${{ github.event.pull_request.title }}" executes as shell. Fix: pass the value through an env: variable and quote it, or validate it first.
  4. Trusting a SHA pin to cover runtime downloads. Pinning an action fixes its code, not a curl | tar that fetches a moving URL during the run. Fix: vendor the payload or verify its checksum.
  5. Treating masking as containment. Masked logs still leak through artifacts, caches, network egress and written files. Fix: give untrusted code no secrets and no shared writable cache.

Interview tips

Open with the invariant: one revision, one immutable artifact, promoted by digest, verified at the boundary. Then name the stage that enforces it.

Expect these follow-ups:

  • Delivery versus deployment? Who holds the release authority, and how that raises the bar on flaky-test rate.
  • Why deploy by digest? Tags are names. Digests are content identity. A signature proves who built it, not that it is correct.
  • A flaky test blocks a Friday release. Quarantine it with an owner and a deadline, ship, then fix the race.
  • A release is erroring: first move? Check whether a flag disable or traffic shift is faster. Rollback re-enters the deploy path.
  • You rolled back and lost data. Application rollback cannot undo a destructive migration. Expand/migrate/contract prevents this.
  • What can a fork PR poison? Shared caches, workspaces on persistent runners, and any artifact a privileged job later reads.

30-second outline: "Each commit builds one digest-addressed artifact. Gates attach evidence to it: fast checks on the PR, integration on the merge, attestation at packaging. Staging and production deploy that same digest with environment config injected at deploy time. Releases are gated by policy, and rollback is a traffic or flag move first. Schema changes use expand/migrate/contract so rollback stays safe."

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.