DevOps Engineer interview questions and answers (2026)
The DevOps Engineer questions candidates are most often asked, covering CI/CD, Docker, Kubernetes, Terraform, Linux. Each answer is short enough to say out loud. For the full process, scenario and HR questions and a 48-hour plan, open the guide for your company below.
Preparing for a DevOps Engineer interview? Rehearse these questions with Interview AI Helper: ask any question and get a suggested answer in seconds, written from your own resume.
Free 5-minute demoDevOps Engineer interview guides by company
- Amazon DevOps Engineer interview questions
- Infosys DevOps Engineer interview questions
- TCS DevOps Engineer interview questions
Most asked DevOps Engineer questions
Which kubectl command displays the current resource usage of a pod?
Use kubectl top pod <pod-name>; it queries the metrics‑server to show CPU and memory consumption for the pod, helping you spot hot spots quickly. If the metrics server is not installed, you would need to deploy it first.
From the Amazon DevOps Engineer guide
What command shows the image layers of a Docker image and their sizes?
Use docker history --no-trunc <image>; it lists each layer, its size and the command that created it, helping you spot unnecessary layers and optimise the image.
From the Infosys DevOps Engineer guide
Explain the difference between a blue‑green deployment and a canary release in a CI/CD pipeline.
A blue‑green deployment maintains two identical environments, one live and one idle. Traffic is switched from the current version to the new version in one step, enabling instant rollback. A canary release sends a small fraction of traffic to the new version, monitors metrics, and gradually increases the share if no issues appear. Both aim to reduce risk, but blue‑green is an all‑or‑nothing switch, while canary provides incremental exposure and early detection of problems.
From the TCS DevOps Engineer guide
How do you configure Docker to limit a container’s memory usage?
Add the --memory flag to docker run, for example docker run --memory 512m <image>. Docker’s cgroup driver enforces the limit, and the container will be killed if it exceeds the allocation, protecting the host.
From the Amazon DevOps Engineer guide
How does a Kubernetes readiness probe differ from a liveness probe?
Readiness determines if a pod can receive traffic; failing it removes the pod from service endpoints but does not restart it. Liveness checks if the container is healthy; failure triggers a restart according to the pod's restart policy.
From the Infosys DevOps Engineer guide
How does Terraform achieve idempotency when applying infrastructure changes?
Terraform builds a state file that records the current real‑world resources. When you run terraform plan, it compares the desired configuration with the state, generating a plan that shows only the changes needed. terraform apply then executes exactly those changes. Because the plan is derived from the difference between desired and actual state, re‑applying the same configuration produces no further modifications, ensuring idempotent behavior.
From the TCS DevOps Engineer guide
What is the purpose of a Terraform backend configuration?
A backend determines where Terraform stores its state file and how it is locked. Using a remote backend such as S3 with DynamoDB enables team collaboration, state versioning and automatic locking to avoid concurrent modifications.
From the Amazon DevOps Engineer guide
Explain the purpose of a Terraform state lock and how it works.
A state lock prevents concurrent runs from corrupting the state file. When a run starts, Terraform writes a lock record to the backend (for example, an S3 object with DynamoDB). Subsequent runs detect the lock and wait or abort until the first run finishes and releases the lock.
From the Infosys DevOps Engineer guide
What command would you use to list all running Docker containers and display their ports?
You would run docker ps --format "{{.Names}} {{.Ports}}". The docker ps command lists containers, and the --format flag customises the output to show each container’s name followed by the port mappings, making it easy to verify which services are exposed and on which host ports.
From the TCS DevOps Engineer guide
DevOps Engineer interview coming up?
Practise these DevOps Engineer questions out loud and get suggested answers in real time, based on your own resume. Free 5-minute demo, no subscription.
Try the free demo