Skip to main content
12 Scenario-Based DevOps Interview Questions (With Answers)

12 Scenario-Based DevOps Interview Questions (With Answers)

KU
· Founder & Chief Editor
• 8 min read•14 views

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.

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.

#ScenarioWhat it really testsFirst command
1Pod in CrashLoopBackOffReading logs from a dead containerkubectl logs <pod> --previous
2Pod stuck PendingScheduler reasoningkubectl describe pod <pod>
3Deploy succeeded, users get 502Probes and Service wiringkubectl get endpoints <svc>
4Plan wants to replace the prod databaseReading a plan before applyingterraform plan, find -/+
5State lock won't releaseSafe recovery under pressureterraform force-unlock <id> (carefully)
6Node disk fullLinux basics on Kubernetesdf -h, crictl images
7A CI dependency was compromisedSecret blast radiusAudit run logs, rotate, pin
8Cloud bill doubled overnightCost triageCost Explorer grouped by service
9Argo CD app is always OutOfSyncControllers vs Gitargocd app diff <app>
10HPA never scalesMetrics pipelinekubectl describe hpa <name>
11Bad release, roll back nowCalm, reversible actionkubectl rollout undo
12Someone dropped a production tableRecovery and blameless follow-upRestore 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:

YAML
# 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"
code
$ 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:

HCL
# 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 textScenarioWhat it means
Back-off restarting failed container1Container keeps exiting; read --previous logs
0/3 nodes are available: 3 Insufficient cpu.2Requests exceed free allocatable CPU
failed to get cpu utilization: missing request for cpu10HPA target has no CPU request
Error acquiring the state lock5Another run holds the lock, or a crashed one left it
The node was low on resource: ephemeral-storage6Kubelet evicted Pods for disk pressure
Instance cannot be destroyed4prevent_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

React
Share this post
Cite this article
Plain text

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

Markdown

[12 Scenario-Based DevOps Interview Questions (With Answers)](https://www.devopsness.com/blog/devops-interview-scenario-questions) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

586 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.