CI/CD Interview Questions and Answers
1. What is CI/CD?
CI/CD stands for Continuous Integration and Continuous Delivery/Deployment. It automates build, test and deployment of applications.
2. What is Continuous Integration?
Frequent code integration into a shared repository with automated builds and tests.
3. What is Continuous Delivery?
Code is always ready for deployment, but production release needs manual approval.
4. What is Continuous Deployment?
Every successful build is automatically deployed to production.
5. Difference between CI and CD?
CI focuses on build and test, CD focuses on deployment.
6. What is a pipeline?
A sequence of automated steps like build, test and deploy.
7. What is Pipeline as Code?
Defining pipeline in code (YAML/Jenkinsfile) stored in Git.
8. What tools are used for CI/CD?
Jenkins, GitHub Actions, GitLab CI, Azure DevOps, AWS CodePipeline.
9. What is an artifact?
Build output like JAR, WAR, Docker image.
10. What is artifact repository?
Stores build artifacts (Nexus, Artifactory, S3).
11. Typical CI/CD pipeline stages?
Code checkout, build, test, scan, package, deploy.
12. What is build automation?
Automatically compiling and packaging code.
13. What is test automation?
Running automated tests in pipeline.
14. What is deployment automation?
Automatic deployment to servers or Kubernetes.
15. What is rollback?
Reverting to previous stable version.
16. What is Blue-Green deployment?
Two environments (blue and green); traffic is switched to new version.
17. What is Canary deployment?
Deploying to a small percentage of users first.
18. What is zero downtime deployment?
Deploying without stopping the running version.
19. What is Git’s role in CI/CD?
Source code management and pipeline trigger.
20. What is webhook?
Triggers pipeline when code changes.
21. What is caching in pipeline?
Storing dependencies to speed up builds.
22. What is parallel execution?
Running multiple stages at the same time.
23. What is GitOps?
Git is the single source of truth for deployment.
24. What is immutable deployment?
Replacing servers instead of modifying them.
25. How do you handle secrets?
Use Vault, AWS Secrets Manager, Azure Key Vault.
26. What is SAST?
Static security scan of source code.
27. What is DAST?
Security scan of running application.
28. What is SBOM?
List of all software dependencies.
29. Build fails after merge. What will you do?
Check logs, fix code and redeploy.
30. Pipeline is slow. How to fix?
Use caching, parallel jobs and optimize steps.
31. Deployment failed but build passed.
Check environment config and server permissions.
32. Secrets exposed in logs.
Rotate secrets and mask variables.
33. Pipeline triggered many times.
Fix webhook and trigger conditions.
34. Wrong version deployed.
Use artifact versioning and promotion.
35. Tests are flaky.
Stabilize and isolate flaky tests.
36. Production bug found.
Rollback, hotfix branch and redeploy.
37. How to add approval before prod?
Add manual approval stage.
38. What is environment separation?
Different configs for dev, test, staging and prod.
39. What is idempotency?
Running same step multiple times gives same result.
40. Why CI/CD is important?
Faster delivery, fewer bugs, automation and quick rollback.
Source: sureshtechlabs.com