12 Scenario-Based DevOps Interview Questions (With Answers)
Senior DevOps interviews have moved from definitions to "it's 2 a.m. and this is broken". Twelve real scenarios, what the interviewer is testing, and the answer that gets the offer.
Key takeaways
- Scenario-based DevOps interviews test how you debug, not what you memorized.
- Strong answers start with the first command you would run, explain what its output tells you, and name the safe fix and the prevention.
- Practice on Pods that crash or stay Pending, risky Terraform plans, leaked CI secrets and surprise cloud bills.
On this page
Scenario questions test your debugging order, not definitions. Answer each in three parts: the first command you'd run, what its output tells you, and the fix plus the prevention. Below are twelve scenarios asked in mid-level and senior DevOps interviews, a lab to reproduce the Kubernetes ones, and the exact error strings to recognize.
Verified against
Kubernetes 1.37, Terraform 1.17, Argo CD 3.5, against the kubernetes.io debugging and HPA docs, the HashiCorp Terraform CLI docs, the Argo CD diffing docs and GitHub advisory GHSA-69fq-xp46-6x23. Checked October 2026.
| # | Scenario | What it really tests | First command |
|---|---|---|---|
| 1 | Pod in CrashLoopBackOff | Reading logs from a dead container | kubectl logs <pod> --previous |
| 2 | Pod stuck Pending | Scheduler reasoning | kubectl describe pod <pod> |
| 3 | Deploy succeeded, users get 502 | Probes and Service wiring | kubectl get endpoints <svc> |
| 4 | Plan wants to replace the prod database | Reading a plan before applying | terraform plan, find -/+ |
| 5 | State lock won't release | Safe recovery under pressure | terraform force-unlock <id> (carefully) |
| 6 | Node disk full | Linux basics on Kubernetes | df -h, crictl images |
| 7 | A CI dependency was compromised | Secret blast radius | Audit run logs, rotate, pin |
| 8 | Cloud bill doubled overnight | Cost triage | Cost Explorer grouped by service |
| 9 | Argo CD app is always OutOfSync | Controllers vs Git | argocd app diff <app> |
| 10 | HPA never scales | Metrics pipeline | kubectl describe hpa <name> |
| 11 | Bad release, roll back now | Calm, reversible action | kubectl rollout undo |
| 12 | Someone dropped a production table | Recovery and blameless follow-up | Restore plan, then postmortem |
Kubernetes: the scenarios asked most
1. "A Pod is in CrashLoopBackOff." Run kubectl logs <pod> --previous, because the current container may have no logs yet. Then kubectl describe pod for the last state: exit code 137 with Reason: OOMKilled is memory, exit code 1 is usually an application error such as missing config. Fix the cause, not the restart policy. Our CrashLoopBackOff guide has the full exit-code table.
2. "A Pod has been Pending for ten minutes." kubectl describe pod and read the Events: FailedScheduling names the reason, usually insufficient CPU or memory, a taint without a toleration, an unsatisfiable affinity rule, or an unbound PersistentVolumeClaim. Say that requests, not actual usage, drive scheduling; fixing FailedScheduling covers each variant.
3. "The deploy succeeded but users get 502s." kubectl get endpoints <svc>. Empty endpoints mean the Service selector doesn't match the Pod labels, or readiness probes are failing. Otherwise check targetPort, then the ingress health checks.
10. "The HPA never scales up." kubectl describe hpa and look for <unknown> targets. The Kubernetes docs are blunt: if a container lacks the relevant resource request, "CPU utilization for the Pod will not be defined and the autoscaler will not take any action." Otherwise it's a missing Metrics Server or maxReplicas reached; see why your HPA isn't scaling.
11. "The release is bad. Roll back now." kubectl rollout undo deployment/<name>, then kubectl rollout status. Roll back first, debug second; the prevention is a canary before full rollout.
Reproduce scenarios 1, 2 and 10 in five minutes
Create these failures on a throwaway kind cluster:
# lab/broken.yaml
apiVersion: v1
kind: Pod
metadata:
name: crasher
spec:
containers:
- name: app
image: busybox:1.37
command: ["sh", "-c", "echo missing DATABASE_URL >&2; exit 1"]
apiVersion: v1
kind: Pod
metadata:
name: too-big
spec:
containers:
- name: app
image: nginx:1.29
resources:
requests:
cpu: "64"
$ kind create cluster --name interview
$ kubectl apply -f lab/broken.yaml
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
crasher 0/1 CrashLoopBackOff 3 (20s ago) 90s
too-big 0/1 Pending 0 90s
$ kubectl logs crasher --previous
missing DATABASE_URL
$ kubectl describe pod too-big | grep -A2 Events
For scenario 10, create a Deployment without resources.requests and kubectl autoscale deployment web --cpu-percent=50 --max=5: the HPA shows <unknown>/50% until you add a CPU request.
Terraform and infrastructure
4. "terraform plan wants to replace the production database." Stop. Find the attribute marked # forces replacement. Common causes are a changed immutable attribute, a renamed resource address, or a provider upgrade. Fix a rename with a moved block, revert the attribute otherwise, and guard stateful resources so a bad plan fails instead of destroying:
# main.tf
moved {
from = aws_db_instance.main
to = aws_db_instance.primary
}
resource "aws_db_instance" "primary" {
# ...
lifecycle {
prevent_destroy = true
}
}
5. "The state lock is stuck and the pipeline is blocked." First confirm nobody is running an apply: check CI and ask the team. Only then run terraform force-unlock <LOCK_ID>, with the ID from the error. The command doesn't touch infrastructure, but unlocking under a live apply lets two writers corrupt state, so the answer interviewers want includes the check.
6. "A node's disk is full." df -h on the node, then find what's large: images (crictl images), logs under /var/log, or emptyDir volumes. Kubelet image garbage collection and log rotation are the prevention; deleting files by hand is the emergency fix.
CI/CD, cost and incidents
7. "A GitHub Action you use was compromised." Treat every secret the affected workflows could read as exposed and rotate them. Check run logs for the exposure window, then pin actions to full commit SHAs and default GITHUB_TOKEN to read-only. Cite the March 19, 2026 aquasecurity/trivy-action compromise, where attackers force-pushed 76 of 77 version tags to credential-stealing code (GHSA-69fq-xp46-6x23). Tag references pulled the malware; the advisory lists workflows pinned to a safe commit SHA as not affected.
8. "The cloud bill doubled overnight." Group cost by service, then usage type, for the last two days. Look for new regions, data transfer, NAT gateways and GPU or large instances. If it looks like crypto-mining, deactivate access keys before investigating further.
9. "Argo CD shows the app OutOfSync forever." argocd app diff <app> to see the field. Usually a controller owns it: an HPA changing spec.replicas or a webhook injecting a sidecar. Remove the field from Git or add ignoreDifferences with jsonPointers: [/spec/replicas]; Argo CD OutOfSync has the full list.
12. "Someone dropped a production table." Stop writes if data is still being lost, restore point-in-time to a new instance, and copy back the missing rows. Then run a blameless postmortem on privileges, review and tested restores.
Error strings you should recognize on sight
| Error text | Scenario | What it means |
|---|---|---|
Back-off restarting failed container | 1 | Container keeps exiting; read --previous logs |
0/3 nodes are available: 3 Insufficient cpu. | 2 | Requests exceed free allocatable CPU |
failed to get cpu utilization: missing request for cpu | 10 | HPA target has no CPU request |
Error acquiring the state lock | 5 | Another run holds the lock, or a crashed one left it |
The node was low on resource: ephemeral-storage | 6 | Kubelet evicted Pods for disk pressure |
Instance cannot be destroyed | 4 | prevent_destroy blocked a replacement, as intended |
Where this breaks
These answers assume a self-managed or standard managed Kubernetes cluster and Terraform with a remote backend. On serverless-first or PaaS teams, scenarios 2, 6 and 10 rarely come up, and interviewers will swap in cold starts, quotas and IAM.
Questions people ask
What are the most common DevOps interview questions in 2026?
The most common are scenario questions: a Pod in CrashLoopBackOff or Pending, a failed or risky deployment, a Terraform plan that would destroy something important, a stuck state lock, a leaked CI secret, and an unexplained cloud bill. Interviewers want your debugging order and reasoning, so name the first command, read its output aloud, and finish with the prevention, not just the fix.
How do I answer scenario-based interview questions?
Use three steps: the first command you'd run, what its output would tell you, then the fix and the prevention. Saying "I'd confirm nobody is applying before I force-unlock" scores better than a fast but risky answer, because interviewers are checking whether you would make an outage worse under pressure.
How should I prepare for a senior DevOps interview?
Break a kind cluster and a Terraform project on purpose and fix them while explaining each step aloud. Prepare two real incident stories with the cause, your fix and what changed afterward. Senior interviews weigh judgment, communication and prevention as much as technical depth, so expect questions like the compromised dependency or the dropped table.
The decision, concretely
- Junior role? Master scenarios 1, 2, 3 and 11 cold; they cover most Kubernetes interview questions.
- Infrastructure-heavy role? Add 4, 5 and 6, and be ready to read a Terraform plan line by line.
- Senior or lead role? Expect 7, 8 and 12, which test judgment and prevention, like most SRE interview questions.
The call we'd make
Don't memorize answers. Build the lab above, break each scenario on purpose, and fix it while explaining aloud. The candidates who get offers sound like they've seen the failure before, because they have.
Sources
Cite this article
Kiril Urbonas (2026). 12 Scenario-Based DevOps Interview Questions (With Answers). DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/devops-interview-scenario-questions
[12 Scenario-Based DevOps Interview Questions (With Answers)](https://www.devopsness.com/blog/devops-interview-scenario-questions) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)
More from DevOps
Explore more articles in this category
kaniko CVE-2026-105769: Lookalike ACR Hosts Get Your Azure Token. Rebuild on v1.25.20
A FROM line pointing at a host like x.azurecr.io.attacker.com is enough to make kaniko hand the build's Entra ID token to that host. Which kaniko forks and images are affected, how to find Azure identities in your build pods, and what to rotate.
Sign Container Images With Cosign: Keyless GitHub Actions Workflow, SBOM and In-Cluster Checks
One workflow that builds, signs keylessly with GitHub OIDC, attaches an SBOM and SLSA provenance, plus the Kyverno policy that refuses anything unsigned. Copy it, change three names, ship it.
GitLab CVE-2026-110264: A Second CVSS 10 RCE in Nine Days. Patch to 19.5.1
An unauthenticated regex-compiler RCE reaching back to GitLab 7.0, no workaround, and backports on older branches that fix only the critical bug. The exact version per branch and the commands to get there.
You might have missed
Evergreen posts worth revisiting.