CI/CD interview questions test whether you understand how code moves safely and automatically from a developer’s commit to production. This guide collects 30 CI/CD interview questions that Indian freshers and career switchers commonly face in DevOps, cloud and SRE interviews, with short answers you can say out loud and pipeline examples you can actually run.
Key takeaways
- Continuous integration means merging small changes often and running an automated build and test on every merge.
- Continuous delivery keeps every build ready to release, while continuous deployment releases every passing build automatically.
- Interviewers expect you to explain pipeline stages, artifacts, environments and rollback in your own words.
- Know at least one tool in depth, such as GitHub Actions, GitLab CI or Jenkins, and be able to write a small pipeline file.
- Security topics like secrets handling and dependency scanning now appear in most CI/CD interviews.
How to use these CI/CD interview questions
Read each answer, then close the page and explain it in two or three sentences. Interviewers rarely want textbook definitions. They want to hear that you have built or at least run a pipeline, and that you understand why each stage exists. If you are still building your foundation, start with our DevOps roadmap and the Docker tutorial for beginners, because most modern pipelines build and ship containers.
Basic CI/CD interview questions
1. What is CI/CD?
CI/CD is a set of practices that automate building, testing and releasing software. CI stands for continuous integration. CD stands for continuous delivery or continuous deployment, depending on whether the final release to production is manual or automatic.
2. What is continuous integration?
Continuous integration is the practice of developers merging small code changes into a shared branch several times a day. Every merge triggers an automated build and test run, so integration problems are found within minutes instead of weeks.
3. What is the difference between continuous delivery and continuous deployment?
In continuous delivery, every change that passes the pipeline is ready to release, but a person approves the production release. In continuous deployment, there is no manual gate: every change that passes all automated checks goes to production on its own.
4. Why do teams use CI/CD?
- Bugs are found earlier, when they are cheaper to fix.
- Releases become small, frequent and less risky.
- Manual, error-prone deployment steps are removed.
- Developers get fast feedback on every change.
5. What is a pipeline?
A pipeline is an automated sequence of stages that code passes through, for example build, test, scan, package and deploy. If any stage fails, the pipeline stops and the team is notified.
6. What are the typical stages of a CI/CD pipeline?
- Source: a commit or pull request triggers the pipeline.
- Build: compile code or build a container image.
- Test: run unit tests, then integration tests.
- Scan: check code quality, dependencies and secrets.
- Package: store a versioned artifact.
- Deploy: release to staging, then production.
7. What is a build artifact?
An artifact is the output of the build stage that gets deployed, such as a JAR file, a ZIP bundle or a Docker image. A good rule is to build once and promote the same artifact through every environment, so what you tested is exactly what you release.
8. Name some popular CI/CD tools.
Common choices are Jenkins, GitHub Actions, GitLab CI/CD, Azure Pipelines, AWS CodePipeline, CircleCI and Argo CD for Kubernetes deployments. In Indian service companies Jenkins is still very common, while product companies and startups often use GitHub Actions or GitLab CI.
9. What is a webhook in CI/CD?
A webhook is an HTTP call that a Git server sends to the CI tool when something happens, such as a push or a new pull request. It lets the pipeline start immediately instead of polling the repository on a timer.
10. What is a runner or agent?
A runner (GitHub, GitLab) or agent (Jenkins, Azure) is the machine or container that actually executes pipeline jobs. Runners can be hosted by the vendor or self-hosted on your own servers.
Intermediate CI/CD interview questions
11. Write a simple GitHub Actions workflow for a Python project.
This workflow runs on every push and pull request, installs dependencies and runs tests with pytest.
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -r requirements.txt
- run: pytest -q12. What is a Jenkinsfile?
A Jenkinsfile is a text file stored in the repository that defines a Jenkins pipeline as code. Keeping it in Git means the pipeline is versioned, reviewed and changed like any other code.
pipeline {
agent any
stages {
stage('Build') { steps { sh 'mvn -B package' } }
stage('Test') { steps { sh 'mvn test' } }
}
}13. What is the difference between declarative and scripted Jenkins pipelines?
Declarative pipelines use a fixed, readable structure with blocks such as pipeline, stages and steps. Scripted pipelines are plain Groovy code and are more flexible but harder to read. Most teams prefer declarative unless they need complex logic.
14. How do you handle secrets in a pipeline?
Never write passwords or keys in the pipeline file. Store them in the CI tool’s secret store or a vault such as HashiCorp Vault or AWS Secrets Manager, inject them as masked environment variables at run time, and give each pipeline only the permissions it needs.
15. What is pipeline caching and why is it useful?
Caching saves files such as downloaded dependencies between runs, so the next run does not download them again. It can cut build times significantly, but the cache key must change when the dependency file changes, otherwise you may test with stale packages.
16. What are parallel jobs and matrix builds?
Parallel jobs run independent tasks at the same time to save time. A matrix build runs the same job across several combinations, for example three Python versions on two operating systems, to catch compatibility problems.
17. What is the test pyramid and how does it apply to CI?
The test pyramid suggests many fast unit tests at the bottom, fewer integration tests in the middle and a small number of slow end-to-end tests at the top. In CI you run unit tests on every commit and heavier suites less often or before release.
18. What is trunk-based development?
Trunk-based development means developers work on short-lived branches, or directly on the main branch, and merge at least daily. It pairs naturally with CI because it keeps branches small and avoids painful merge conflicts.
19. What are feature flags?
Feature flags let you deploy code with a new feature switched off and turn it on later without a new deployment. They separate deployment from release and make it easy to switch a broken feature off quickly.
20. What is Infrastructure as Code in a CI/CD context?
Infrastructure as Code means defining servers, networks and cloud resources in files, using tools such as Terraform or Ansible. The pipeline can then plan and apply infrastructure changes the same way it deploys application code. Our Terraform interview questions cover this area in depth.
Advanced CI/CD interview questions
21. Explain blue-green deployment.
You run two identical environments, blue (live) and green (new version). After testing green, you switch traffic to it. If something breaks, you switch traffic back to blue, which gives a near-instant rollback.
22. Explain canary deployment.
A canary release sends a small share of real traffic to the new version first. If error rates and latency stay healthy, you increase the share step by step until all users are on the new version.
23. What is a rolling deployment?
A rolling deployment replaces old instances with new ones a few at a time. Kubernetes Deployments do this by default. It needs no extra environment, but for a while both versions serve traffic, so they must be compatible.
24. How do you roll back a failed deployment?
The safest approach is to redeploy the previous known-good artifact. In Kubernetes you can run the command below. Database changes need extra care, which is why teams write backward-compatible migrations.
kubectl rollout undo deployment/web-app25. What is GitOps?
GitOps treats a Git repository as the single source of truth for what should run in an environment. A controller such as Argo CD or Flux watches the repository and keeps the cluster in sync, so deployments happen through pull requests.
26. What is DevSecOps and which scans belong in a pipeline?
DevSecOps means building security checks into the pipeline instead of testing security at the end. Typical scans are static code analysis (SAST), dependency or SCA scanning, container image scanning and secret detection.
27. How do you make a slow pipeline faster?
- Cache dependencies and Docker layers.
- Run independent jobs in parallel.
- Run only the tests affected by a change, where your tooling supports it.
- Use smaller base images and faster runners.
28. What is a flaky test and how do you deal with it?
A flaky test passes and fails on the same code without any change. Teams usually quarantine it, fix the root cause such as timing or shared state, and track flaky tests so they do not erode trust in the pipeline.
29. Which metrics show that a CI/CD process is healthy?
The four DORA metrics are widely used: deployment frequency, lead time for changes, change failure rate and time to restore service. Pipeline duration and success rate are useful day-to-day indicators.
30. Describe a CI/CD pipeline you have built.
This is almost always asked. Describe a real project: the repository, the trigger, each stage, where the artifact was stored and where it was deployed. A simple personal project, such as a Flask app built into a Docker image and deployed to a cloud VM with GitHub Actions, is perfectly acceptable for a fresher.
How to prepare for a CI/CD interview
Build one pipeline end to end before your interview. Push a small app to GitHub, add a workflow that tests it, builds a Docker image and deploys it. Break it on purpose and fix it. That single exercise will help you answer most CI/CD interview questions with confidence, and it gives you a project to show. Pair it with Kubernetes interview questions if the role mentions containers in production.
Frequently asked questions
Is CI/CD part of DevOps?
Yes. CI/CD is one of the core practices of DevOps, alongside Infrastructure as Code, monitoring and collaboration between development and operations teams.
Which CI/CD tool should a fresher learn first?
GitHub Actions is the easiest place to start because it is built into GitHub and needs no server. Learn Jenkins next, since many Indian companies still run it.
Do I need coding skills for CI/CD roles?
You need basic scripting in Bash or Python and comfort with YAML. You do not need to be an application developer, but you must be able to read build errors and test output.
How many CI/CD questions are asked in a DevOps interview?
It varies by company, but CI/CD is usually one of the main topics, often combined with Git, Docker, Kubernetes and cloud questions.
Explore more guides in our DevOps section.
