DevOps Engineer Interview Questions & Answers
40 questions for DevOps Engineer interviews — 2 easy, 34 medium, 4 hard.
About the DevOps Engineer role
A DevOps engineer automates the full delivery path from commit to production. They build CI/CD pipelines, containerise applications, run Kubernetes clusters, provision cloud infrastructure with Terraform and set up monitoring and alerts. They work closely with developers to improve release speed and stability and take part in on-call rotations. Most openings ask for two to five years of experience with AWS or Azure and Kubernetes.
You need one pipeline that deploys to dev, staging and production with approval before production. How do you design it?
Show answer
A pod is stuck in Pending state. What could be the reasons?
Show answer
Tell me about a mistake you made in infrastructure work and what you learned.
Show answer
Write a production-ready Dockerfile for a Node.js application.
Show answer
Explain the Jenkins controller and agent architecture.
Show answer
Your Docker image is 1.5 GB. How do you reduce its size?
Show answer
How do you manage secrets in a CI/CD pipeline?
Show answer
How do you add a health check to a Docker image?
Show answer
What is the difference between declarative and scripted Jenkins pipelines?
Show answer
Compare blue-green, canary and rolling deployments.
Show answer
Two containers on the same host cannot talk to each other. What do you check?
Show answer
Describe how you handled an on-call incident late at night.
Show answer
How do you limit CPU and memory for a container?
Show answer
A pod is in CrashLoopBackOff. How do you troubleshoot it?
Show answer
Builds fail randomly because of flaky tests. How do you handle it?
Show answer
What is the difference between a security group and a network ACL?
Show answer
How do you perform a rolling update and roll back a Deployment?
Show answer
A production deployment failed halfway. What do you do?
Show answer
How do you run a matrix build in GitHub Actions?
Show answer
What is a DaemonSet and when is it used?
Show answer
What does idempotency mean in Ansible?
Show answer
How do containers work under the hood using namespaces and cgroups?
Show answer
An Ansible playbook run against 100 servers failed on 7 of them. What do you do?
Show answer
Tell me about a production deployment that went wrong and how you handled it.
Show answer
What is the difference between an Ingress and a Service?
Show answer
Write a multi-stage Dockerfile for a Java Spring Boot application.
Show answer
Pods are running but the service is not reachable. How do you debug it?
Show answer
What are Ansible roles?
Show answer
What are Ansible handlers and how do you use them?
Show answer
The kernel OOM killer keeps killing your application. How do you handle it?
Show answer
How do Docker image layers and build caching work?
Show answer
The host disk is filling up because of Docker. How do you clean up and prevent it?
Show answer
Explain Ansible architecture: inventory, modules and playbooks.
Show answer
What are the best practices for securing Docker images?
Show answer
How do you use stored credentials inside a Jenkins pipeline?
Show answer
How do you build and push a Docker image from a pipeline?
Show answer
Explain Docker network types.
Show answer
What is the difference between count and for_each in Terraform?
Show answer
How do you handle pressure when a release is blocked close to a deadline?
Show answer
Frequently asked questions
What does a DevOps Engineer do?
A DevOps engineer automates the full delivery path from commit to production. They build CI/CD pipelines, containerise applications, run Kubernetes clusters, provision cloud infrastructure with Terraform and set up monitoring and alerts. They work closely with developers to improve release speed and stability and take part in on-call rotations. Most openings ask for two to five years of experience with AWS or Azure and Kubernetes.
Which skills are tested in a DevOps Engineer interview?
Expect questions on CI/CD design, Kubernetes operations, Terraform, AWS services, Prometheus and Grafana. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a DevOps Engineer interview?
Revise CI/CD Pipelines, Docker and Containers, Kubernetes, Infrastructure as Code (Terraform and Ansible) first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.