Senior Engineering Interview Handbook / Chapter 101
CI/CD and Release Engineering
A production-engineering foundation chapter about artifact integrity, risk-shaped pipeline gates, environment promotion, feature flags, canaries, blue-green releases, progressive delivery, rollback boundaries, and release ownership.
Page tools
A green pipeline is evidence, not permission
The checkout team is replacing a rule-based fraud check with a new risk engine. Its pull request has been reviewed. Unit and contract tests are green, the security scan is clean, the container starts in staging, and the deployment job completes. None of this answers the question that will decide whether the release is safe: does the new engine block good customers or approve bad transactions under production traffic?
CI can establish facts about source, artifacts, and known failure modes. A release system must carry those facts into a controlled encounter with what the pipeline cannot reproduce: real request shapes, dependencies, data, customer behavior, and operational pressure.
That gives CI/CD three related but distinct jobs. Integration keeps changes small enough to review and failures close to their cause. Continuous delivery produces a deployable artifact and the evidence needed to promote it. Release engineering controls exposure to the behavior and chooses what to do with the evidence that returns.
Give the release an identity
The first control is mundane and easy to violate: know exactly what is moving toward production. Build once from reviewed source, store the output as an immutable artifact, and promote that same output. A container image is one kind of artifact; a binary, package, static bundle, mobile build, infrastructure plan, or migration bundle can play the same role.
For the risk engine, the release record might contain:
source 4f6c2d1, reviewed by payments-risk owners
service risk-engine@sha256:7a91...
model fraud-model-2026-07-15.3
policy checkout-thresholds@81b4...
evidence unit, contract, replay, latency, dependency and secret scans
exposure disabled
owner release lead and checkout on-call
mitigation disable new decisions; route to the legacy rules
The service digest alone is insufficient. Model versions, thresholds, feature allocation, infrastructure, and permissions can change behavior without a new binary. Treat that state as versioned release input: validate it, record it, make changes auditable, and decide which parts are reversible. Otherwise a team can faithfully promote the same container while running a different release in every environment.
Building separately for staging and production destroys an important diagnostic fact. After a failure, the team must then ask whether the code, dependency resolution, build tool, configuration, data, or environment changed. Promoting one artifact does not make staging equivalent to production—its traffic, secrets, capacity, dependencies, and data seldom are—but it removes one source of uncertainty.
Make each gate answer for a risk
A pipeline is not stronger because it contains more jobs. Each gate should say which release decision it informs and what action follows a failure.
The fast path for the risk engine checks formatting, types, focused unit behavior, policy syntax, secret leakage, and the service contracts touched by the change. Broader jobs replay labeled transactions, exercise checkout and payment-provider contracts, test timeouts and fallbacks, and measure latency and saturation on the critical path. A change to an authorization boundary would deserve denied-actor and cross-tenant tests. A schema change would deserve compatibility checks, migration rehearsal, and backfill verification. The pipeline grows from the failure shape, not from a standard inventory.
A gate has operational cost: runtime, flakes, diagnosis, ownership, and delay. When it fails often but cannot tell anyone what to do, engineers learn to rerun or bypass it. That is not rigor. Keep universal checks quick, reserve expensive checks for changes that carry the corresponding risk, and make an emergency bypass an explicit, time-bounded decision with an owner and an audit trail.
Passing the gates narrows uncertainty; it does not eliminate it. Historical replay can expose false decisions in the sample but cannot reproduce tomorrow’s transaction mix. Staging can verify wiring but not prove behavior under production load. A mature release record says what the evidence covers and where confidence ends.
Deployment changes location; release changes exposure
The team first deploys the risk engine with the checkout path disabled. The code is now present in production, but no customer decision depends on it. Shadow mode sends a copy of eligible requests to the engine while suppressing payment and user-facing side effects. The team can compare new and legacy decisions, observe latency and dependency behavior, and inspect disagreements without yet allowing the new answer to approve or block a transaction.
Shadowing has a hard limit: it reveals what the engine would decide, not how a customer or an adversary would respond. It can also be dangerous when the supposed shadow performs a write, consumes a scarce quota, emits a message, or changes a downstream model. Side effects must be disabled or isolated, not merely ignored after they occur.
Once shadow evidence is credible, a feature flag exposes the new decision path to a bounded cohort. The first cohort should be informative, not simply small. One percent chosen at random may miss a rare payment method, a large merchant, or a region with a different provider. The release owner chooses segments that limit harm while still exercising the risks the team needs to see.
This separation between presence and exposure is useful beyond flags:
- A canary sends a production slice to the new version. Its value depends on whether that slice can reveal the suspected failures.
- Rings move from an internal or tolerant cohort toward broader use. They become ceremony when every ring advances without explicit evidence.
- Blue-green deployment keeps two production environments and switches traffic between them. The switch may reverse code quickly, but shared databases, queues, sessions, and caches still have to remain compatible.
- A dark launch prepares production capacity before user-visible behavior is enabled. It can prove readiness of machinery, not correctness of the product outcome.
- An all-at-once release can be reasonable for a low-consequence, familiar, easily reversed change. Progressive delivery is a control to apply, not a ritual every change must endure.
The rollout shape follows reversibility, blast radius, and the distribution of risk. It should never be selected only because the deployment platform offers a convenient button.
Let the canary make a decision
Before enabling the checkout cohort, the team writes the decision policy. Service errors, p95 and p99 latency, saturation, and provider timeouts show whether the engine can serve traffic. Checkout completion, authorization success, approval and challenge rates, decisions later confirmed as fraud, and support contacts show whether the release is doing useful work. Each view needs the relevant payment-method, region, merchant, and risk-band slices so an aggregate cannot conceal a harmed group.
The policy also names sample-size and time requirements. Ten quiet minutes may establish that the process stays alive; they cannot establish the quality of a decision whose outcome arrives days later. Some signals can permit a ramp now. Others justify keeping the legacy path until delayed labels arrive.
Suppose the canary is technically healthy but prepaid-card challenges rise far outside the replayed range. That observation is enough to pause exposure, even before the team knows whether the model, policy thresholds, or input data caused it. The release has not failed because it stopped. The control worked: the team found an unanswered risk before granting it a global blast radius.
This is the handoff to operational readiness. Release engineering needs signals and thresholds that can decide ramp, pause, or mitigate. The next chapter develops the SLO, alert, dashboard, and runbook policies by which a team owns the service after the rollout window closes.
Rollback is a boundary, not a button
For the paused risk engine, disabling the flag routes new decisions back to the legacy rules. That is faster than deploying an old image, but it does not undo challenges already shown to customers. The team may need to preserve decision records, re-evaluate affected transactions, inform fraud operations, or give support a way to explain the event. Binary rollback addresses only one layer of the release.
Before exposure, ask what each kind of change permits:
- Code and configuration may be reverted if the previous version still understands current state.
- Traffic can be switched or drained if both destinations remain healthy and compatible.
- A bad dependency interaction may require fallback, isolation, or a roll forward rather than restoring old code.
- A sent notification, leaked permission, external API response, or customer decision cannot be unsent. Future harm can be stopped; past effects require repair or mitigation.
- Data transformation can move the rollback boundary permanently.
Database changes make the last case visible. Expand the schema first. Deploy code that tolerates the old and new shapes. Backfill in bounded batches with verification and pause controls. Switch reads only after the new data earns confidence. Contract the old shape after every required consumer has moved and rollback no longer depends on it. The release plan should name the moment when restoring old code stops being safe and repair becomes the recovery path.
Compatibility creates similar constraints without a database. Producers and consumers rarely update together; mobile clients and external API consumers may remain old for months. Add before removing, tolerate mixed versions, and observe adoption before contracting the interface. A successful producer deploy is weak evidence if deployed consumers cannot understand its output.
Finish what the pipeline started
After healthy ramp-up, temporary controls begin to decay. Flags create untested combinations. Shadow traffic consumes capacity. Dual writes and old schemas keep two meanings alive. Release-only dashboards lose their audience. The legacy engine becomes less trustworthy each week it remains available but unexercised.
Cleanup is therefore part of the release, with an owner and an evidence-based condition: delayed fraud outcomes have arrived, peak traffic has been seen, required client versions have adopted the contract, or the compatibility window has closed. Remove the flag and dead path, retire temporary comparison jobs, preserve useful monitoring, and record any new failure condition in the tests or platform controls that should catch it next time.
The completed release has kept two histories. The artifact record explains what was built and promoted. The rollout record explains who was exposed, what the team observed, why it changed exposure, where recovery changed from revert to repair, and who closed the temporary paths. Neither pipeline YAML nor a green deployment alone can tell that story.
Use one risk to make the answer credible
In a system design interview, release judgment belongs where the design meets compatibility, migration, dependency, and deployment topology. In a production engineering discussion, it belongs in artifact provenance, pipeline policy, rollout choice, and health decisions. In a project deep dive, it belongs in the evidence that changed a real launch plan rather than in a claim that the team used CI/CD.
A concise answer to the checkout prompt could sound like this:
The main risk is a healthy service making harmful decisions. I would build one
identified service artifact, version the model and thresholds with it, and map
pipeline gates to checkout contracts, replay quality, latency, and failure
behavior. I would shadow without side effects, then canary an informative set
of payment methods and regions. Technical health and customer outcomes would
control the ramp. The legacy rules remain available until delayed fraud
labels arrive, and the release record names when disablement is sufficient and
when affected decisions need repair.
To practice, choose a change you know well and write its release record from memory: artifact, configuration, evidence, exposure state, decision thresholds, mitigation, rollback boundary, and cleanup condition. Then alter one fact. Let a shadow call retain a side effect, make the first cohort miss the riskiest traffic, separate a policy change from its audit record, or delay the outcome signal for a week. Revise the release state and the next decision, not only the test list.
A pipeline earns trust by preserving what it knows and remaining honest about what it does not. Release engineering turns that boundary into controlled exposure, a decision, and a recovery path before production supplies the answer at full scale.
Related links
Continue reading
Full table of contents