Learn › Interview prep

DevOps and CI/CD Interview Questions for Infrastructure Engineers

Interview questions on CI/CD, Git, Jenkins, GitHub Actions, Docker, Kubernetes, Terraform and cloud – answered from an infrastructure engineer's point of view.

Intermediate 12 min read
By Gopinath Karthikeyan

Moving from Windows administration into DevOps or cloud roles? Interviewers will check that you understand the toolchain and – more importantly – why it exists. Model answers below.

CI/CD and Git

1. Continuous delivery vs continuous deployment? Delivery: every change that passes the pipeline is ready to release, usually with a manual approval. Deployment: it’s released automatically. Most infrastructure teams do delivery with an approval for production.

2. What stages would your pipeline for an Ansible role have? Lint (ansible-lint, YAML checks) → run against a lab in check mode → apply to lab → verify → manual approval → apply to production in batches → verify and report. Triggered on pull requests for the early stages, on merge for deployment.

3. Merge vs rebase? Both integrate changes. Merge keeps history and adds a merge commit; rebase rewrites your commits on top of the target for a linear history. Never rebase shared branches.

4. How do you stop someone pushing broken code to main? Branch protection: required pull requests and approvals, required status checks, CODEOWNERS, no force pushes, no bypass for admins.

Jenkins and GitHub Actions

5. Controller vs agent in Jenkins? The controller schedules builds, stores config and results; agents run the builds. Run builds on agents (controller executors = 0) for security and to have the right tools and network access.

6. How do you handle secrets in a pipeline? In the platform’s credential store, injected only into the steps that need them (withCredentials, secrets.*), passed as environment variables, masked in logs, never echoed or committed. Separate credentials per environment.

7. GitHub-hosted vs self-hosted runners? Hosted: zero maintenance, fresh VM each run, no access to your private network. Self-hosted: inside your network, can reach servers, but you maintain and secure it – never attach to public repos.

Containers

8. Container vs VM? A VM virtualises hardware and runs a full OS; a container shares the host kernel and packages only the app and its libraries – faster to start, smaller, less isolated.

9. Image vs container? Where does data go? An image is the read-only template; a container is a running instance. Container filesystems are disposable – persistent data goes in volumes.

10. A pod is in CrashLoopBackOff. What do you do? kubectl describe pod for events, kubectl logs --previous for the crash output. Common causes: bad config or missing secret, failing dependency, wrong command, memory limit (OOMKilled), failing probes.

Infrastructure as code

11. Terraform vs Ansible? Terraform provisions infrastructure (networks, VMs, DNS) and tracks it in state; Ansible configures what runs inside. They’re commonly used together.

12. What is Terraform state and how do you protect it? Terraform’s record of the real resources it manages. Store it in a remote backend with locking and encryption, restrict access (it can contain secrets), never edit by hand or commit to Git.

13. What’s drift? Differences between the code/state and reality, usually from manual changes. terraform plan shows it; fix by updating code or reverting the manual change, and limit portal access.

Cloud and culture

14. How would you migrate 300 Windows servers to the cloud? Discover and inventory, map dependencies, choose rehost/rebuild/retire per app, prepare the landing zone (network, identity, security, monitoring, backup), pilot wave, then waves with tests, cutover plans and rollback. (Migration guide)

15. What does DevOps mean to you? Shared ownership between people who build and run systems, automation of repetitive work, small frequent changes with fast feedback, and learning from incidents without blame. Give an example of something you automated and what it improved.

What’s next

Next: SRE interview questions – incidents, SLOs and postmortems.

Practise this topic

Test yourself with free questions on this topic – instant answers and explanations.

Start practice questions

Interview PrepDevOpsCI/CDDockerKubernetesTerraformIntermediate

Gopinath Karthikeyan

Gopinath Karthikeyan – Windows Site Reliability Engineer with about 12 years in enterprise Windows Server infrastructure, and founder of WinOps Academy. YouTube · LinkedIn

More in Interview prep