DevOps Engineer interview question · Most asked
Design a CI/CD pipeline for a containerised microservice from commit to production.
Summary
On every commit: build once, run fast checks (lint, unit tests, static analysis), build and scan the container image, publish it with an immutable tag, run integration tests against it, then promote that same artifact through staging to production with automated deployment, progressive rollout and automatic rollback on bad metrics.
Longer Answer
A concrete shape:
- Pull request: lint, unit tests, SAST and dependency scanning, build image, ephemeral preview environment if useful.
- Merge to main: build image tagged with the commit SHA, generate SBOM and sign it, push to the registry.
- Staging: deploy automatically (GitOps update of the image tag), run integration, contract and smoke tests.
- Production: deploy the same digest with a canary or progressive rollout, watching SLIs, and roll back automatically on regression; database migrations follow expand-and-contract.
Cross-cutting: secrets via OIDC and a secret manager (no long-lived keys in CI), pipeline as code reviewed like application code, fast feedback (minutes, not hours), and DORA metrics to track improvement.
Key Points
- Build once, promote the same artifact.
- Fast checks first; scan and sign images.
- Automated staging; progressive production rollout.
- OIDC credentials; pipelines as code; measure DORA.
Deep dive: Docker interview questions
Explanation
What interviewers look for
An end-to-end flow with artifact promotion, safety mechanisms and security, not just a list of tools.
Follow-up questions
- Where do database migrations run in this pipeline?
- How would you keep the pipeline under 10 minutes?
More most-asked DevOps Engineer questions
- Pods keep restarting with OOMKilled under load. How do you investigate and fix it?
- Every deployment produces a burst of 502s. What do you check?
- What happens when you type a URL into a browser and press Enter?
- A rollback after a release made the outage worse because the database had already been migrated. How do you design releases so rollbacks are always safe?
- How do you handle database schema migrations in an automated deployment pipeline?
- What are DORA metrics, and how would you use them without gaming them?
- How do you handle secrets in CI/CD pipelines securely?
- Your CI pipeline takes 45 minutes. How would you speed it up?