DevOps Engineer interview question · Most asked
Your CI pipeline takes 45 minutes. How would you speed it up?
Summary
Measure where time goes, then: cache dependencies and Docker layers, run independent jobs in parallel and split test suites across runners, run only what changed (affected-project detection in monorepos), move slow end-to-end tests out of the per-commit path into a later stage, fix or quarantine flaky tests, and use faster runners where the cost is justified.
Longer Answer
Targets: under 10 minutes for the commit stage is a common goal, because slow feedback leads to batching changes and context switching. Also check for waiting rather than working (queued jobs, insufficient runners), redundant steps (building the same thing twice), and tests that sleep. Track pipeline duration and failure rate as metrics over time.
Key Points
- Measure first.
- Cache, parallelise, shard tests.
- Run only affected work.
- Fix flaky tests; move slow tests later.
More most-asked DevOps Engineer questions
- What happens when you type a URL into a browser and press Enter?
- Pods keep restarting with OOMKilled under load. How do you investigate and fix it?
- Design a CI/CD pipeline for a containerised microservice from commit to production.
- How do you handle secrets in CI/CD pipelines securely?
- 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?
- What are DORA metrics, and how would you use them without gaming them?
- How do you handle database schema migrations in an automated deployment pipeline?
- Every deployment produces a burst of 502s. What do you check?