CI/CD interview questions and answers
CI/CD interview questions test whether you can design a path from commit to production that is fast, repeatable and safe to undo. Expect pipeline stages and ordering, trunk-based development versus long-lived branches, building an artifact once and promoting it, environments and approvals, blue-green, canary and rolling deployments, feature flags, rollback, secrets and supply chain security, and how to measure delivery with the DORA metrics. The questions are mostly tool-neutral; examples here use GitHub Actions.
By Evin JohnPublished 7 min read
Where CI/CD questions come up
CI/CD questions appear in DevOps, platform, SRE and release engineering interviews, and increasingly in backend and full-stack loops where engineers own their deployments. Tool-specific rounds exist (see Jenkins interview questions), but most interviewers care more about the design: what runs when, what gets deployed, how you know it worked and how you go back. Infrastructure changes have their own pipeline concerns, covered in Terraform interview questions.
- ConceptsContinuous integration, delivery and deployment, branching, artifacts and environments.
- Design a pipelineFor a service or a monorepo: stages, ordering, caching, approvals and where tests run.
- Release scenariosA bad deploy at peak traffic, a database migration, a flaky test blocking everyone.
- Security and metricsSecrets, permissions, dependency risk, signing, and how you would show delivery is improving.
CI/CD fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Continuous integration, continuous delivery and continuous deployment: what is the difference? | Definitions | CI merges small changes often and checks each with automated builds and tests. Continuous delivery keeps every passing change releasable, with a person choosing when. Continuous deployment releases every passing change automatically. |
| What belongs in a CI pipeline, in what order? | Ordering | Cheap, fast checks first (lint, compile, unit tests), then slower ones (integration tests, security scans), then build the artifact. Fast failures save time and runner cost. |
| Why build once and promote the same artifact? | Artifacts | Rebuilding per environment can produce different binaries from the same commit. Building once, tagging with the commit and promoting that exact artifact means production runs what was tested. |
| What is an artifact repository for? | Storage | A versioned, immutable store for build outputs such as container images and packages, with retention rules, so deployments pull known versions rather than building on the fly. |
| What is trunk-based development? | Branching | Everyone merges small changes into the main branch at least daily, behind feature flags when work is unfinished. It keeps merges small and the main branch always releasable. |
| When do long-lived branches make sense? | Trade-offs | For maintaining several released versions, such as supported product lines or mobile app versions waiting for review. They cost merge effort and delay integration, so keep them few and short where possible. |
| Why should pipeline configuration live in the repository? | Pipeline as code | It is versioned and reviewed with the code it builds, and changes to how software ships go through the same review as the software. |
| What is an environment in CI/CD, and why have several? | Environments | A target such as staging or production with its own configuration, credentials and approval rules. Earlier environments catch problems before customers see them. |
| How do you make pipelines faster? | Speed | Cache dependencies, run independent jobs in parallel, split slow test suites, only build what changed in a monorepo, and keep the build context small. |
Pipeline design questions
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read # least privilege by default
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # pin third-party actions to a full commit SHA
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm test
build:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # OIDC: short-lived cloud credentials, no stored keys
outputs:
image: ${{ steps.push.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/ci-build
aws-region: eu-west-1
- id: push # the script writes image=<ref> to $GITHUB_OUTPUT
run: ./scripts/build-and-push.sh "${{ github.sha }}"
deploy-staging:
needs: build
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
# cloud login omitted: needs id-token: write and a deploy role, as in build
- run: ./scripts/deploy.sh staging "${{ needs.build.outputs.image }}"
deploy-production:
needs: [build, deploy-staging]
runs-on: ubuntu-latest
environment: production # protection rules can require a reviewer
steps:
- uses: actions/checkout@v4
# cloud login omitted, as in staging
- run: ./scripts/deploy.sh production "${{ needs.build.outputs.image }}"- What runs on a pull request versus on main? Pull requests get the fast checks and whatever proves the change is safe to merge. Main gets the full set, builds the release artifact and starts the deployment path.
- How do you handle a flaky test that blocks everyone? Quarantine it so it no longer blocks merges, open a ticket with an owner and a deadline, and fix or delete it. Automatic retries hide the problem and should be tracked, not trusted.
- How do you design CI for a monorepo? Detect which packages changed and build and test only them and their dependents, with a shared remote cache. Run the full suite on a schedule to catch what path filters miss.
- Where do integration and end-to-end tests belong? Integration tests on every merge with real dependencies in containers. A small set of end-to-end tests against staging after deploy, because they are slow and brittle at scale.
- How do you version releases? Tie every artifact to a commit SHA, and add semantic version tags for things others depend on, such as libraries and public APIs.
- What are environment protection rules and approvals for? Limiting who and what can deploy to sensitive environments: required reviewers, wait timers, allowed branches and environment-scoped secrets.
Deployment strategy and rollback questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Rolling deployment: how does it work and what can go wrong? | Rolling | Instances are replaced a few at a time while the rest serve traffic. Old and new versions run side by side, so both must work with the same database and API contracts. |
| What is a blue-green deployment? | Blue-green | Two full environments; the new version goes to the idle one, gets checked, and traffic switches over at once. Rollback is switching back, at the cost of running double capacity during the release. |
| What is a canary release? | Canary | Send a small share of traffic to the new version, compare its error rate and latency with the current version, and widen the share in steps or roll back automatically if it looks worse. |
| What do feature flags add? | Decoupling | They separate deploying code from releasing a feature, so unfinished work can ship dark and a feature can be turned off without a deploy. Old flags must be removed, or they turn into hidden complexity. |
| How do you roll back, and when do you roll forward instead? | Recovery | Redeploy the previous artifact or flip a flag when the cause is unclear or impact is high. Roll forward with a small fix when the cause is obvious and a rollback is risky, for example after a data migration. |
| How do you deploy database schema changes safely? | Migrations | Expand and contract: add new columns or tables in a backward-compatible way, deploy code that writes both, backfill, switch reads, and remove the old structure in a later release. |
| What health signals should gate a deployment? | Verification | Readiness checks per instance, plus service-level signals after the release: error rate, latency, saturation and key business events, compared with the previous version. |
Secrets and supply chain questions
- How should a pipeline authenticate to a cloud provider? With OIDC federation: the CI system issues a short-lived token that the cloud trusts for a specific repository, branch or environment, so no long-lived keys are stored.
- Where do pipeline secrets live? In the CI platform's secret store or an external secrets manager, scoped to the environment and job that need them, never in the repository or build logs.
- What is a software supply chain attack in CI terms? Compromising something your build trusts, such as a dependency, a third-party action or plugin, or the build system itself, so malicious code ships inside a legitimate release.
- How do you reduce supply chain risk? Lockfiles and pinned versions, third-party actions pinned to commit SHAs, dependency and image scanning, minimal token permissions, review on pipeline changes, signed artifacts and recorded build provenance. SLSA is one framework that organizes these practices into levels.
- What is an SBOM and why produce one? A software bill of materials listing the components inside an artifact. When a new vulnerability is announced, it tells you which releases are affected without rebuilding anything.
- Why are pull requests from forks dangerous for CI? Untrusted code runs in your pipeline. Run fork pull requests without secrets and with read-only permissions, and be careful with triggers that run in the base repository's privileged context.
Senior CI/CD and measurement questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What are the DORA metrics? | Measurement | The classic four are deployment frequency, lead time for changes, change failure rate and time to restore service after a failed change. They are traditionally grouped as two speed and two stability measures; later DORA reports have renamed and added some, so mention the version you know. |
| How would you use the DORA metrics without gaming them? | Judgement | Track trends for a team, not targets for individuals, look at all four together so speed does not come at the cost of stability, and use them to find bottlenecks rather than rank teams. |
| A deploy at peak traffic raised the error rate. Walk me through it. | Incident | Stop the rollout, roll back or switch the flag off, confirm the error rate recovers, then find the cause with the artifact diff, logs and traces. Afterwards add the missing check to the pipeline. |
| Lead time from merge to production is two days. How do you shorten it? | Flow | Map where the time goes: queueing for runners, slow tests, manual approvals, batched release windows. Fix the largest wait first, often by automating approvals for low-risk changes. |
| How do you give fifty teams consistent pipelines without blocking them? | Platform | Reusable workflows or templates for common project types, owned and versioned by a platform team, with clear extension points and a path for exceptions. |
| Should every merge deploy to production automatically? | Trade-offs | It works well with good tests, progressive delivery and fast rollback. Regulated environments or mobile releases may need a manual approval, which should be a quick decision, not a long queue. |
| How do you deploy a change that spans two services? | Compatibility | Make each change backward compatible and deploy them independently: the provider first, supporting both old and new behavior, then the consumer, then remove the old path. |
Fictional example
- Interviewer
- We are starting a new HTTP service that four engineers will work on. Design the pipeline from commit to production.
- Candidate
- I would start with trunk-based development: short-lived branches, a pull request with lint, unit tests and a build check that finish in a few minutes. On merge to main, the pipeline runs the full test suite, builds one container image tagged with the commit and pushes it to the registry with a scan and a signature. That image deploys automatically to staging, where a short smoke test runs. Production uses the same image through a canary: a small share of traffic first, automatic comparison of error rate and latency, then the rest. Rollback is redeploying the previous image, and new features ship behind flags so we can turn them off without a deploy. Credentials come from OIDC, not stored keys. To know if it is working, I would track the DORA delivery metrics from day one.
A one-week CI/CD practice plan
- Days 1 and 2: build a pipeline for a small app with lint, tests and a build, then cut its run time with caching and parallel jobs.
- Day 3: add an image build tagged with the commit and promote that same image to two environments.
- Day 4: set up OIDC to a cloud sandbox and remove every stored key.
- Day 5: simulate a rolling and a blue-green deploy locally or in a sandbox and practice a rollback.
- Days 6 and 7: practice the design question and the incident scenario out loud, in under five minutes each.
Related guides: DevOps engineer interview questions for the full loop, Ansible interview questions for configuration management in deployment pipelines, and backend developer interview questions for the service side of the same story.
Pipeline design answers are long, and the parts that score, such as how you roll back, tend to get squeezed at the end. Natively, an AI interview assistant for Mac and Windows, transcribes your mock design rounds on your computer so you can check that rollback, secrets and metrics all made it in. In practice it can read a workflow file or a failing job's log from a screenshot and point at the likely problem, and with Pro or the free trial it can use the résumé and job description you add. You keep the transcript and notes for review.
Questions people ask
What CI/CD questions are asked in interviews?
The difference between continuous integration, delivery and deployment, pipeline stages and ordering, trunk-based development, building once and promoting artifacts, environments, blue-green, canary and rolling deployments, feature flags, rollback, secrets, supply chain security and DORA metrics.
What is the difference between blue-green and canary deployments?
Blue-green switches all traffic from the old environment to a fully deployed new one at once, with instant switch-back. Canary sends a small share of traffic to the new version first and widens it only if its metrics hold up.
What are the DORA metrics?
The classic four are deployment frequency, lead time for changes, change failure rate and time to restore service after a failed change. Later DORA reports have renamed and extended them, so name the version you are describing.
How do I answer a CI/CD pipeline design question?
Walk from commit to production: checks on pull requests, a full suite and a single build on merge, promotion of the same artifact through environments, a progressive rollout, rollback, secrets handling and how you would measure the result.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
