CI/CD & Deployment interview question
How do you use build caching and dependency caching to speed up CI pipelines?
How you'd do it Asked in DevOps Engineer · Site Reliability Engineer (SRE) · QA Engineer / SDET interviews
Summary
Cache dependencies (node_modules, pip packages, Go modules) between pipeline runs so they're downloaded once, not on every build. Cache build outputs (compiled artifacts, Docker layers) so only changed code is rebuilt. The cache key should include the lock file hash so it invalidates when dependencies change.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More CI/CD & Deployment questions
- What is shift-left testing, and what security scanning belongs in a CI pipeline?
- What are best practices for writing Dockerfiles?
- How do you handle flaky tests in CI?
- How would you design CI/CD for a microservices architecture?
- What's the difference between continuous integration, continuous delivery and continuous deployment?
- How do you promote a single build artifact from development through staging to production?
- Compare rolling, blue-green and canary deployments.
- What stages does a typical CI/CD pipeline contain?