DevOps Engineer Interview Questions
40+ original questions across Linux, Git, CI/CD, Docker, Kubernetes, Terraform, Ansible, monitoring, incident response, and the AI-era skills every DevOps interview now touches.
15 Fresher16 Mid-Level10 Senior
Fresher
A process on a production server shows up as a zombie in ps aux. What does that mean, and should you be worried?
A zombie process has already finished executing — it exited and released almost all of its resources (memory, file descriptors) — but its entry still sits in the process table because its parent hasn't called wait to read its exit status yet. It isn't consuming CPU or meaningful memory, so a handful of zombies by themselves aren't an emergency. The real concern is a parent process that never reaps its children: zombies then accumulate indefinitely, and since the process table has a fixed size, enough of them can eventually block new processes from being created on that system. The fix isn't to try to kill the zombie directly (you can't — it's already dead), it's to find and fix or restart the parent so it reaps properly, or restart the parent process entirely to clear the zombies it's holding.
What interviewers look for
- defines a zombie as already-terminated, just not yet reaped by its parent
- distinguishes it clearly from a hung or stuck process
- explains the real risk is table exhaustion from an unreaping parent, not the zombie itself
Likely follow-up: How would you find which parent process is responsible?
df -h reports a filesystem at 100% full, but du -sh /* under that mount doesn't add up anywhere close to that much. What's going on?
The most common explanation is a deleted file that a running process is still holding open. When a process has a file descriptor open and the file gets deleted, the directory entry disappears immediately — so
du, which walks the visible directory tree, no longer counts it — but the underlying disk blocks aren't freed until every process holding it open closes that handle. df reports real block usage at the filesystem level, so it still sees the space as used. lsof | grep deleted (or lsof +L1) surfaces exactly which open file descriptors point at unlinked files and which process holds them; restarting or signaling that process to close the handle reclaims the space. A separate possibility worth ruling out is inode exhaustion rather than block exhaustion — df -i shows that and it produces the same symptom of 'full' with nothing obvious in du.What interviewers look for
- identifies a deleted-but-still-open file handle as the likely cause
- names the diagnostic command (lsof, for deleted files)
- explains why du doesn't see it but df still counts it
Likely follow-up: What if
df -i shows the inodes are exhausted instead?What's the practical difference between git merge and git rebase, and when would you avoid rebase?
Merge and rebase both bring one branch's work into another, but they handle history differently. Merge adds a new commit with two parents on top of your current branch, so every commit from both branches is still there in the order it was made, and you can see exactly where the two lines joined. Rebase takes the commits unique to your branch and reapplies them one at a time onto the tip of the target branch, so the result looks like a single straight line with no merge point — but each of those reapplied commits gets a brand-new hash, because it is a new commit, not the original. That rewriting is the catch: once a commit has been pushed and someone else might have it, rebasing it swaps out commits they're relying on for different ones with the same content but different hashes, and their copy of history now disagrees with yours. Rebasing commits that only exist on your own machine, before you've pushed them, carries none of that risk — there's nobody else's history to diverge from yet.
What interviewers look for
- explains merge preserves original commits and creates a merge commit
- explains rebase replays commits, producing new hashes and linear history
- states the rule: avoid rebasing commits already pushed/shared with others
Likely follow-up: Why is rewriting shared history risky for teammates?
What happens when you run git pull, and why might running git fetch first and looking before integrating be the safer habit?
git pull is really two steps combined into one command: it fetches new commits from the remote, then immediately merges (or, with --rebase, rebases) those commits into your current branch. The convenience is also the risk — you don't see what changed upstream before Git starts integrating it into your working branch. git fetch on its own only updates your local remote-tracking references (like origin/main) and never touches your working directory or current branch, so it's always safe to run. The safer two-step habit is git fetch followed by something like git log HEAD..origin/main to see what's incoming, then deciding deliberately whether to merge, rebase, or investigate further — especially useful right after you suspect something unusual happened upstream, like a force-push or a large unexpected change, where blindly pulling could produce a confusing result.What interviewers look for
- explains pull is fetch plus an automatic merge or rebase
- explains fetch alone never touches the working directory or current branch
- gives the practical benefit: inspecting what changed before integrating it
Why shouldn't a CI system's controller node run build jobs directly, rather than dispatching them to separate agents?
The controller's job is to schedule work and serve the UI/API for the entire instance — every team's pipelines depend on it staying responsive. If the controller also executes build jobs itself, a single hung process, a memory-heavy build, or even a malicious build script can degrade or crash the controller, which then affects every other job and every other team on that instance, not just the one build that misbehaved. Running builds on separate agent machines or ephemeral agent pods isolates that blast radius deliberately: a bad build can take down the agent running it, but the controller keeps scheduling everything else normally, and a fresh agent just picks up the next job. This separation is also why agents are usually treated as disposable — if one gets into a bad state, replacing it is cheap and doesn't touch the controller.
What interviewers look for
- explains the controller's role is scheduling/UI, not running builds itself
- explains a bad build can degrade or crash the controller, affecting every other job
- connects agent isolation to containing that blast radius
How do you keep credentials out of a pipeline definition file while the pipeline still needs to use them?
A pipeline definition should hold nothing more sensitive than a name or identifier pointing at where a credential is kept, never the credential's value written out in the file. The platform's own credential store, or an external secrets manager, owns the real value and hands it to the running job only at execution time, through an injected environment variable or a mounted file, so the definition itself stays something you could hand to anyone without exposing anything. That separation also makes rotating a credential painless: the store gets updated once, and every pipeline referencing it by name picks up the new value automatically, with no pipeline file needing to change. One thing this doesn't automatically protect against is a build step that carelessly prints an environment variable to its own log output — keeping the secret out of the pipeline file doesn't stop a script inside that pipeline from accidentally exposing it somewhere else during the run.
What interviewers look for
- references credentials by ID/name from a store, never a literal value in the pipeline file
- explains why this keeps the pipeline file itself safe to read or share
- mentions rotation becomes simpler since no pipeline file needs editing
Likely follow-up: What's the risk if a secret ends up printed in build logs instead of the pipeline file?
How is a Docker image different from a Docker container, and why does that distinction matter in practice?
An image is a read-only template: a layered filesystem plus metadata like the default entrypoint, exposed ports, and environment defaults, built once from a Dockerfile and never modified after that. A container is a running (or stopped) instance created from that image — it gets its own thin writable layer on top of the image's read-only layers, plus its own process, network namespace, and filesystem state that's independent of any other container. Because the image itself never changes, you can start many containers from the same image at once, and each one's writes go only into its own writable layer — nothing a container does during its lifetime ever affects the underlying image, or any other container started from it. Deleting a container just discards that container's writable layer; the image it came from is completely unaffected and can be used to start a fresh container again at any time.
What interviewers look for
- image = read-only template/layers, built once and not modified afterward
- container = a running instance with its own independent writable layer
- explains many containers can run from one image independently without affecting each other or the image
Why use a multi-stage Dockerfile instead of building everything in a single stage?
A single-stage Dockerfile bakes the entire toolchain used to build the application — compilers, build dependencies, source files — into the same final image that gets shipped and run, even though none of that is needed once the application is built. That means a bigger image, a larger attack surface (every build tool is now a potential vulnerability inside a running production container), and slower image pulls. A multi-stage build splits this into separate stages: one stage has the full toolchain and does the compiling or building, and a later, minimal stage copies in only the finished build artifact, discarding the build stage's layers entirely from the final image. For compiled languages especially, this routinely takes an image from several hundred megabytes down to a small fraction of that, because the shipped image ends up containing just the compiled output and a minimal runtime base, not an entire development environment.
What interviewers look for
- explains build tools and source stay confined to an earlier stage, never reaching the final image
- names the concrete benefit: smaller final image and reduced attack surface
- connects this to compiled languages seeing the largest size reduction
Likely follow-up: What other techniques reduce image size further, beyond multi-stage builds?
What is a Kubernetes Pod, and why doesn't Kubernetes just schedule containers directly instead?
A Pod is the smallest deployable unit Kubernetes schedules — it's a wrapper around one or more containers that are always scheduled together onto the same node, share the same network namespace (so they share one IP and can reach each other over localhost), and can share storage volumes between them. Most Pods run exactly one container, and the single-container case is by far the most common in practice. The multi-container case exists for coupled processes that need to share network and storage but still have independent lifecycles and images — a main application container plus a sidecar that ships its logs elsewhere is the typical example. In production, you almost never create a bare Pod directly: a Deployment or StatefulSet manages a set of Pods for you, handling replacement when one fails and coordinating rolling updates, rather than you managing individual Pod lifecycles by hand.
What interviewers look for
- defines a Pod as the smallest deployable unit, wrapping one or more containers scheduled together
- explains the shared network namespace between containers in a Pod (same IP, reachable via localhost)
- notes Pods are normally managed via a Deployment/StatefulSet rather than created directly
In a Terraform configuration, what's the practical difference between a variable block, a resource block, and an output block?
A
resource block is the thing you're asking Terraform to create and manage — a VPC, a database instance, a storage bucket — and it's the only one of the three that results in something real existing in the cloud account once applied. A variable block defines a substitutable input to the configuration — things like region, instance size, or environment name — so the same configuration can be reused across dev, staging, and production by simply changing variable values rather than duplicating the whole configuration for each environment. An output block defines what gets reported back once the apply finishes — something another part of the system, a separate Terraform module, or a CI pipeline step might need afterward, like the ID or endpoint of a resource that was just created. None of this provisions anything on its own — writing resource, variable, and output blocks is purely planning; nothing real exists until terraform apply runs.What interviewers look for
- resource = the infrastructure Terraform creates/manages
- variable = a substitutable input, enabling reuse across environments
- output = information reported back after apply, for other consumers
Ansible is often described as 'agentless.' What does that mean, and what does it require on the managed nodes instead?
It means there's no persistent Ansible agent process that has to be installed and kept running on every machine Ansible manages — unlike some configuration-management tools that require a long-running daemon on each managed host checking in with a central server. Instead, Ansible connects to each managed node over a connection it already has available — normally SSH — runs the modules it needs for that specific task, and then disconnects; nothing Ansible-specific is left running on the target afterward. What it does require on the target side is SSH access and Python, since the modules it pushes over and executes are Python under the hood (with some exceptions for agentless-style network device modules). This makes Ansible noticeably lighter to adopt across a large or varied fleet: there's no agent rollout or agent-version-compatibility problem to manage across hundreds of machines, just making sure SSH and Python are available, which on most Linux servers is already true by default.
What interviewers look for
- explains no persistent agent process runs on managed nodes between playbook runs
- names SSH and Python as what's required on the target instead
- connects this to the lighter adoption cost compared to agent-based tools
A playbook task reports changed every single time you run it, even though nothing is different on the target. What's the likely cause, and how do you fix it?
This is almost always caused by using the
command or shell modules for something that has a proper dedicated module available instead. command/shell just run a literal command and report changed based on whether the command executed, with no real concept of 'was anything different beforehand' — so a command like creating a directory reports changed every run regardless of whether the directory already existed. A module written for that specific purpose — file for directories/permissions, package for installed packages, service for running state — first checks the target's current state and only reports changed if it had to do something to reach the desired state; run it again with nothing to change and it correctly reports no change. The fix is swapping the shell/command call for the equivalent purpose-built module wherever one exists. ansible-playbook playbook.yml --check --diff is the way to verify idempotency directly — a truly idempotent playbook run against an already-correct target should show no changes on a second run.What interviewers look for
- names non-idempotent modules (command/shell) as the typical cause
- contrasts with a proper declarative module that checks current state first (file/package/service)
- mentions --check/--diff as the way to verify idempotency, not just assume it
What's the difference between an Ansible ad-hoc command and a playbook, and when would you reach for each?
An ad-hoc command is a single module run directly from the command line against some set of hosts in the inventory, with nothing saved anywhere afterward —
ansible all -m ping to check connectivity, or a one-off command to restart a service right now, are typical examples. It's quick, but it's a one-time action: there's no record of it beyond your shell history, and running the exact same thing again later means typing it again. A playbook is a YAML file describing a set of tasks meant to be run repeatedly and kept under version control, which makes it the right choice for anything that represents real, ongoing configuration rather than a quick check or an emergency one-off fix. The practical rule of thumb is reaching for an ad-hoc command when you just need to verify something or take a single immediate action, and writing a playbook the moment the same steps are likely to be needed again, by you or anyone else, since only the playbook leaves a reusable, reviewable record behind.What interviewers look for
- defines an ad-hoc command as a single, one-off module run with nothing saved afterward
- defines a playbook as a reusable, version-controlled set of tasks
- gives a practical rule for choosing between them (quick check/one-off vs. repeatable configuration)
Why does Prometheus pull metrics from applications instead of having applications push them in?
With a pull model, the monitoring system itself decides when and how often to check each target, and a failed attempt becomes meaningful data on its own — a target that doesn't answer gets marked as down for that interval automatically, which is a useful signal in its own right rather than just a gap in the data. This also shifts responsibility away from the instrumented application: it has no idea who is watching it or how often, carries no logic for reconnecting or retrying against a collector, and only has to answer when it's asked. The one case this doesn't naturally cover is a process that starts, finishes, and exits entirely within the gap between two collection intervals — there's no live target left to check by the time anyone would look. That's precisely why a push-based side door exists for this model: a short-lived job can hand its results off to an intermediary that stays running to be polled normally, rather than the whole monitoring approach switching away from pulling as its general pattern.
What interviewers look for
- explains pull gives Prometheus control over scrape timing and visibility into target health (up==0 on failure)
- explains applications don't need to know where monitoring lives or handle their own retry logic
- acknowledges the Pushgateway exists for short-lived batch jobs, not as a contradiction of the pull model
Walk through the typical lifecycle of a production incident, and explain what MTTR measures.
A typical incident moves through detection (something alerts, or a user/teammate reports it), triage (figuring out severity and scope — how bad, how many users affected), escalation (pulling in the right people and declaring if warranted), mitigation (stopping the impact, which isn't necessarily the same as fixing the root cause yet), resolution (the fix or a stable workaround is in place), and finally a post-mortem to understand what happened and prevent a repeat. MTTR, Mean Time to Recovery, measures the time from an incident starting to the service being restored to normal — it is not the same as time to find the root cause; a team can restore service quickly with a mitigation (rolling back a bad deploy, for instance) well before they've understood why it broke. Because different severities have very different expected response times and impact, MTTR is usually tracked separately per severity level rather than as one blended average, since mixing a P1 outage's recovery time with a minor P3's recovery time would obscure what's going on in either category.
What interviewers look for
- names the stages in a sensible order: detection, triage/severity, escalation, mitigation, resolution, post-mortem
- defines MTTR correctly as time to recovery, distinct from time to root-cause
- notes MTTR is usually tracked per severity rather than as one blended number
Mid-Level
A 4-core server reports a load average of 10, but top shows almost no CPU usage. How do you explain that, and where do you look next?
Linux load average isn't a pure CPU metric the way it's often assumed to be — it counts both processes that are runnable on the CPU and processes stuck in uninterruptible sleep (D state), which usually means they're blocked waiting on I/O, most often disk or network storage. A high load number with low reported CPU usage is the classic signature of an I/O-wait problem, not a compute problem: a lot of processes are queued, but they're queued behind slow storage, not behind the CPU scheduler. The next step is confirming that directly rather than guessing —
vmstat 1 shows the 'r' column (CPU-runnable count) versus the 'b' column (processes blocked on I/O) side by side, and a high 'b' count confirms the I/O-wait theory. From there, iostat -x points at which device is saturated, and the investigation shifts to that disk, that network mount, or whatever backing storage those processes are stuck waiting on.What interviewers look for
- knows Linux load average includes I/O-wait (D-state) processes, not just CPU-runnable ones
- names a concrete tool to confirm the split (vmstat's r vs b columns)
- connects the symptom to a likely root cause area (disk/NFS/storage), not just CPU
Likely follow-up: The disk itself looks healthy on this host — what else can put processes into D state?
A commit you pushed yesterday turns out to be broken. Why would you usually git revert it rather than git reset --hard plus a force-push?
git revert creates a brand-new commit whose changes are the exact inverse of the commit being undone — it adds to history rather than rewriting anything that already exists. That matters because the broken commit was already pushed: anyone who pulled since then already has it in their local history. git reset --hard moves your branch pointer backward and discards the commit from your local branch, but to undo it on the shared remote you'd need to force-push, which rewrites the remote branch's history out from under everyone who already based work on it — their local history and the new remote history now disagree, and resolving that divergence is painful and error-prone for every teammate affected, not just you. Revert avoids all of that: it's just a normal new commit that anyone can pull normally, with a clear record in history of what was undone and why, which also makes the incident easier to trace later.What interviewers look for
- explains revert adds a new, safe commit rather than rewriting existing history
- explains why reset + force-push is dangerous because the commit was already pushed/pulled
- describes the divergence problem this creates for teammates who already pulled the bad commit
Likely follow-up: Is there a situation where reset plus force-push is the right call here?
A pipeline that used to finish in 8 minutes now takes well over half an hour. How do you diagnose this instead of guessing at the cause?
Start from real data, not a guess: most CI systems have a per-stage timeline view that shows exactly where the extra time went, and that's the first thing to open before forming any theory. In roughly descending order of how often this turns out to be the cause: dependency or build caching silently broke, so every run does a full reinstall instead of reusing cached layers; a new stage got added that could have run in parallel with an existing one but was wired up to run serially instead; agent provisioning got slower, whether that's an ephemeral agent pod taking longer to start or a shared static agent pool being busier than before; or a specific step's external dependency — a slow API call, a test suite that grew, a flaky network call with retries — got slower on its own and needs its own separate investigation. The point is narrowing it to one specific stage first using the timing data, rather than changing several things at once and hoping.
What interviewers look for
- starts from real per-stage timing data rather than guessing
- lists concrete, specific causes: broken caching, serial stages that could parallelize, agent provisioning overhead, a slower dependency
- treats it as an evidence-driven investigation, narrowing to one stage before acting
Likely follow-up: Caching turns out fine and the stages are already parallel — what do you check next?
Why is putting a secret in an ENV or ARG instruction in a Dockerfile unsafe, even if a later instruction appears to remove it?
Docker images are built as a stack of layers, and each layer is effectively immutable and cached independently — a later layer 'deleting' something doesn't remove it from the earlier layer where it was written, it just means that specific file isn't visible in the final merged filesystem view. The earlier layer, secret and all, is still physically part of the image and gets shipped with it. Anyone with access to the image can recover that value with ordinary tooling —
docker history or docker inspect can reveal build-time ARG/ENV values, and pulling the image and inspecting its individual layers directly exposes anything written into any of them, regardless of what a subsequent layer did. The safer alternatives keep the secret out of any layer entirely: BuildKit's secret mount feature makes a secret available only during the build step that needs it, without it ever being written into a layer; injecting secrets at container-run time as environment variables or mounted files means they're never part of the image; and fetching secrets at application runtime from an external secrets manager avoids baking them in anywhere in the pipeline.What interviewers look for
- explains layers are immutable and cached — a later layer removing something doesn't erase it from an earlier layer
- names a concrete way the secret is recoverable (docker history/inspect, or direct layer inspection)
- names at least one real alternative: BuildKit secret mounts, runtime injection, or an external secrets manager
A Pod under heavy load becomes slow to respond. Should that trip its liveness probe or its readiness probe, and why does the distinction matter?
It should trip the readiness check, not the liveness check. Readiness governs whether a Pod is currently eligible for new traffic — once it starts failing, the orchestrator simply stops sending requests its way and waits for it to recover, without touching the running container process. Liveness asks an entirely different question: whether the container's own process has become unresponsive and needs to be killed and relaunched. Wiring both checks to the same underlying signal is a recurring misstep in real clusters, because a Pod that's merely overloaded and answering slowly then gets torn down and restarted on top of already being overloaded, instead of being quietly excluded from the traffic rotation until it catches up on its own. That extra restart adds startup overhead at exactly the moment the Pod needed breathing room, not a cold restart — the opposite of what the situation calls for.
What interviewers look for
- correctly identifies readiness, not liveness, as the one that should trip here
- explains readiness failing removes the Pod from traffic without restarting it
- explains why conflating the two causes unnecessary restarts under load, not just a theoretical distinction
Likely follow-up: How would you configure both probes so this scenario behaves correctly?
A Service exists and has a ClusterIP, but nothing can reach the application behind it. What's the most common root cause, and how do you confirm it quickly?
By far the most common cause is a label-selector mismatch — the Service's
spec.selector doesn't match the labels on the Pods you intended it to route to, not a networking failure. A Service with zero matching Pods doesn't error out or disappear; it still exists, still accepts connections, and still has a ClusterIP — it simply has nowhere to forward traffic, which from the outside looks exactly like a generic connectivity problem. The fastest way to confirm this is kubectl get endpoints <service-name> (or kubectl describe service <service-name>): if the endpoints list is empty, that confirms the selector problem directly, before spending time on anything network-level like NetworkPolicy, DNS, or kube-proxy. Comparing the Service's selector against kubectl get pods --show-labels on the Pods you expect it to hit usually reveals the mismatch immediately — a typo in a label key, or Pods deployed with a slightly different label set than the Service was written against.What interviewers look for
- identifies a label-selector mismatch as the most likely cause, not a networking bug
- explains the Service still exists and accepts connections even with zero matching endpoints
- names the concrete check: kubectl get endpoints / describe service, before the pods' own labels
terraform apply fails with a state lock error. What usually causes this, and what's the safe way to resolve it?
Terraform's state lock exists to stop two applies from running against the same state at the same time and corrupting it. The error almost always means one of two things: a previous apply crashed or was killed mid-run and never released its lock, or another apply (possibly from a CI pipeline, possibly from a teammate) is running right now against the same state. The critical step before doing anything else is confirming which of those two it is — checking whether a CI pipeline run or a teammate's terminal session is currently mid-apply — because force-unlocking while an apply is still in progress can let two applies run concurrently against the same state, which is exactly the corruption scenario the lock exists to prevent. Only once that's ruled out is
terraform force-unlock <lock-id> safe to run, using the lock ID from the error message. The prevention going forward is structural: running applies through a CI pipeline with a mutex or queue so only one can ever run at a time, rather than relying on people remembering not to apply concurrently.What interviewers look for
- explains the lock usually means a prior apply crashed mid-run, or another apply is in progress
- stresses confirming nothing is running before force-unlocking, not unlocking reflexively
- names the fix (terraform force-unlock) and a structural prevention (CI mutex/queue)
Likely follow-up: How would you confirm nothing else is applying before you force-unlock?
You change one small setting on a resource and terraform plan shows it will be destroyed and recreated entirely. Why does this happen, and how do you find out exactly what forced it?
Some resource attributes simply can't be changed in place on the cloud provider's side — the provider's API has no 'update' operation for that specific field, only create and delete — so Terraform's only option to apply the change is to destroy the existing resource and create a new one with the new value. Common examples vary by resource type but typically include things like an immutable identifier, an availability zone, or a field the provider's API treats as fixed at creation time. The way to find out exactly which attribute triggered it, rather than guessing from the changed line alone, is reading the plan output itself closely — Terraform explicitly annotates the forcing attribute, and
terraform plan -out=plan.tfplan followed by terraform show plan.tfplan gives the full detail if the terminal output got truncated. Once you know which attribute it is, the real decision is whether that forced replacement is acceptable for this resource (a brief downtime window during a maintenance window, for instance) or whether the change needs a different, non-destructive approach entirely, like provisioning a parallel resource and migrating traffic before removing the old one.What interviewers look for
- explains some attributes force replacement because the provider's API has no in-place update for that field
- names a concrete way to identify which attribute forced it directly from the plan output
- distinguishes an acceptable forced replacement from one that needs a different, non-destructive migration approach
You need the same configuration applied consistently across 200 servers. How does Ansible's inventory-plus-playbook model make that manageable compared to configuring each one by hand?
The inventory defines the group of hosts once — which 200 servers belong to which logical group (web servers, database servers, a specific environment) — and the playbook defines the desired configuration once, as a set of tasks, completely separately from any individual host. Running the playbook against the group applies the exact same tasks to every host in it in one operation, rather than someone manually repeating the same steps 200 times with the inevitable small inconsistencies that introduces along the way. The real durability benefit shows up over time, not just on the first run: when the configuration needs to change later, that change happens once in the playbook, and running it again brings every host in the group to the new desired state — there's no per-host drift to track down, because nothing was ever configured by hand. Grouping also lets different configurations target different subsets cleanly, like applying a web-server-specific playbook only to the web group while a separate database playbook targets only the database group from the same inventory.
What interviewers look for
- explains the inventory defines the host group once, the playbook defines the configuration once
- explains the same tasks apply identically to every host in the group in one run
- highlights the ongoing benefit: future changes happen once in the playbook, not re-applied by hand per host
Likely follow-up: How would you roll a change out to 10% of those hosts first before the rest?
You need to track request latency so you can compute percentiles like p95/p99 later. Would you use a Counter, a Gauge, or a Histogram, and why?
A Histogram is the right choice here. A Counter only ever increases (aside from resetting on restart) and is meant for running totals like total request count — it has no concept of a distribution of individual observation values, so it can't represent latency. A Gauge tracks a current value that can go up or down, like active connections or memory usage right now — also not a fit, since latency is a per-request observation, not a single current-state value. A Histogram buckets each observed latency value into predefined ranges, and that bucketed data is exactly what lets you compute percentiles after the fact with
histogram_quantile, calculated server-side from the raw bucket counts. The alternative, a Summary, calculates quantiles client-side at scrape time, which is cheaper for Prometheus to store but produces a real problem at scale: those pre-calculated quantiles can't be correctly aggregated across multiple instances afterward, so if you need a fleet-wide p99 rather than just one instance's p99, Histogram is the one that supports that.What interviewers look for
- correctly picks Histogram and explains why Counter and Gauge don't fit a latency-distribution use case
- explains bucketed observations enable histogram_quantile percentile calculation server-side
- explains why Histogram, not Summary, is the right choice when aggregating across multiple instances matters
A Grafana panel shows 'No data.' What's your diagnostic order for finding out whether the problem is the query itself, the datasource connection, or something further upstream?
Start by running the identical query straight against the data source's own query interface, skipping Grafana's dashboard entirely — Grafana sits between you and the real data, so looking there first risks debugging the wrong layer of the stack. If that direct query also comes back empty, the issue has nothing to do with the dashboard: a metric name that's since changed, a label filter that no longer matches any series, or a target that stopped being scraped are the usual suspects, and every one of them lives upstream of Grafana entirely. If instead the data source returns results when queried directly, but the panel still shows nothing, the fault is specific to how that panel is configured — check first whether its selected time window overlaps with when the data exists, since that alone explains a surprising share of 'missing' panels, and only after ruling that out look at whether the datasource connection itself has drifted, for instance after the backend's address changed.
What interviewers look for
- checks the raw query directly against Prometheus's own UI first, not just inside Grafana
- if the raw query also returns nothing, correctly concludes the problem is upstream of Grafana entirely
- if the query works in Prometheus but not Grafana, checks time range and datasource configuration next
How do you decide whether something is a P1 versus a P2 incident, and why does getting that call right matter operationally?
The core distinction is customer-facing impact and scope: a P1 typically means a customer-facing outage affecting all or most users, which calls for alerting the entire relevant on-call rotation immediately and treating it as the top priority above everything else in flight. A P2 is significant degradation but partial — some users or some functionality affected, not a full outage — which still needs urgent attention but doesn't necessarily justify pulling in the same breadth of people at the same urgency. Getting this classification right matters beyond just the label, because severity typically drives concrete operational differences: different response-time SLAs, different notification scope (who gets paged), and different expectations around status-page communication to customers. Under-classifying a P1-scope issue as a P2 means the right people aren't engaged fast enough and customer communication lags behind impact; over-classifying routine P2s as P1 burns out the on-call rotation and erodes the signal value of a P1 page over time, since people start treating every page as potentially not that urgent.
What interviewers look for
- distinguishes P1 (customer-facing/broad impact, full on-call engagement) from P2 (partial degradation)
- connects severity to concrete operational consequences — SLAs, notification scope, communication expectations
- explains the cost of misclassifying in either direction, not just defining the levels
What makes a post-mortem 'blameless' in practice, beyond just saying it is?
A blameless post-mortem is built around the assumption that the people involved acted reasonably given the information and context they had at the time — not with the benefit of hindsight everyone now has after the incident. The analysis focuses on systems and process gaps rather than individual decisions: instead of 'why did this engineer do X,' the question is 'what about our systems, tooling, or process made it possible or likely that X would happen, and why didn't anything catch it sooner.' A useful technique for reaching that systemic root cause rather than stopping at the surface is Five Whys — repeatedly asking why the previous answer happened until the chain lands on something structural. The concrete signal that a post-mortem is blameless, not just labeled that way, is where the action items end up: they're assigned to fixing systems and processes, with real owners and dates, not to 'be more careful next time' aimed at a person. That structure is also what creates the psychological safety for people to be fully honest about what happened, which is the entire point — a team that fears blame will quietly omit details next time.
What interviewers look for
- explains the focus is on systems/process, assuming people acted reasonably with the information they had
- names Five Whys (or an equivalent technique) for reaching a systemic root cause rather than a surface one
- identifies the concrete signal: action items go to systems/processes with owners, not to individual blame
Likely follow-up: How do you keep a post-mortem blameless when the root cause really was someone skipping a documented step?
A teammate opens a PR with AI-generated Terraform for a new production database. What do you check before approving it, beyond just 'does the plan output look reasonable'?
The plan output needs the same scrutiny you'd give a human-written change, not less — a clean-looking plan summary isn't proof of correctness, and a confidently-generated change can still get specifics wrong. Start by reading the resource-level details rather than trusting the overall shape: does it expose anything to a wider network range than intended, are IAM permissions scoped as narrowly as the task needs rather than broad defaults, do naming and tagging follow the team's existing conventions, and is the region/account target the right one. Pay particular attention to anything the plan shows as a forced replacement or deletion, since that's exactly the kind of destructive consequence that's easy to skim past in a long plan output if you're reading quickly. The underlying principle is that the review bar doesn't drop just because the author is an AI tool instead of a person — if anything, treating it with equal or slightly more scrutiny than a human-authored PR touching the same resources is the safer default until there's real track-record evidence either way.
What interviewers look for
- checks specific resource-level details (network exposure, IAM scope, naming/tagging) rather than trusting the plan summary alone
- flags forced-replacement or deletion operations as needing closer attention
- treats the review bar as equal to or higher than a human-written PR, not lower because an AI produced it
Likely follow-up: What's different about reviewing this compared to reviewing a human-written PR touching the same resources?
Your team lets an AI coding agent open PRs directly against the main branch. What CI and pipeline guardrails matter because the author is an agent rather than a person?
The required checks shouldn't be relaxed for agent-authored PRs — if anything the same full test suite, linting, and review gates should apply with no shortcut, since an agent can produce a plausible-looking but subtly wrong change just as easily as, and sometimes more fluently than, a person can. The guardrail that matters because the author is an agent is scoping what its CI credentials and permissions can reach: an agent that can open PRs doesn't need standing credentials capable of deploying to production or modifying infrastructure directly, and keeping that scope tight limits the damage any single bad or manipulated PR from it could do, independent of how good the review process is. Requiring human approval before merge, rather than auto-merging once checks pass, is the other concrete guardrail — automated checks catch things they're designed to catch, but a human reviewer catches the kind of contextual or intent-level mistake (a change that's technically correct but solves the wrong problem) that CI alone won't.
What interviewers look for
- treats agent-authored PRs through the same required checks as human ones, not a relaxed bar
- scopes the agent's own CI credentials/permissions narrowly (least privilege), independent of the review process
- requires human approval before merge rather than auto-merging once automated checks pass
Likely follow-up: How would you decide which repos or change types are safe to let an agent merge with less oversight, if any?
You're asked to run an LLM inference service on Kubernetes. What's different about scheduling and capacity planning here compared to a typical stateless web service?
The biggest difference is GPU scheduling: a typical web service schedules on ordinary CPU/memory requests across any generally available node, but an inference workload usually needs to land on nodes with GPUs, which means node selectors, taints, and tolerations become load-bearing rather than optional — a Pod stuck Pending here is far more likely to mean 'no GPU capacity currently available in the cluster' than a generic scheduling bug, and that's the first thing to check rather than assuming a misconfiguration. Resource requests and limits for GPU allocation matter at least as much as CPU/memory ever did for a normal service, since GPU memory is a hard, often expensive constraint that doesn't flex the way CPU can briefly burst. Capacity planning also has to account for model-serving-specific characteristics that don't apply to a typical stateless app: meaningful cold-start/load time when a new replica comes up (loading model weights isn't instant the way starting a typical container is), and a cost profile per request that's usually far higher than a typical API call, both of which should shape autoscaling thresholds rather than reusing the same CPU-utilization-based rules a normal service would use.
What interviewers look for
- explains GPU scheduling needs (node selectors/taints/tolerations) and that Pending here often means no GPU capacity, not a bug
- notes GPU memory/resource allocation is a hard constraint, unlike CPU which can briefly burst
- accounts for model-serving-specific characteristics (cold start, per-request cost) shaping autoscaling differently than a stateless service
Senior
A systemd service starts cleanly when you run it manually, but fails every single time on boot. How do you root-cause this rather than just restarting it and moving on?
This pattern almost always comes down to a difference between the environment at boot time and the environment of an interactive shell, or a dependency the unit assumes is ready but isn't yet. Start with
journalctl -u <service> -b to see exactly what failed during that specific boot, not a generic re-run. Common real causes: the unit's After=/Requires= doesn't wait for what it needs — a service that calls out over the network but only depends on network.target instead of network-online.target can start before the interface has a route, which is fine manually (network is already up by the time you log in) but fails at boot. Environment differences matter too: a boot-time service doesn't source .bashrc or inherit an interactive shell's $PATH, so a script relying on an environment variable that's normally just 'there' when you run it by hand can fail silently at boot. The fix is making the dependency explicit in the unit file and setting any required environment there directly, not assuming it will be inherited.What interviewers look for
- identifies unit ordering/dependencies as the prime suspect, not a flaky service
- names journalctl -u <service> -b for boot-time logs, not just a generic status check
- distinguishes the manual-run environment (interactive shell, network already up) from the boot-time environment
Likely follow-up: The unit already has
After=network-online.target and still fails — what do you check next?You run git pull and get a divergence error because a teammate force-pushed to the shared branch. Walk through how you'd recover without losing your own unpushed work.
The first move is
git fetch origin rather than another pull — fetch only updates the remote-tracking reference and is always safe, giving you a clean view of what the remote now looks like without touching your branch. Next, inspect what changed before acting: comparing your current branch against the new origin/main shows whether commits you were based on were truly replaced (a deliberate rebase or amended commit) rather than this being some other kind of error. Critically, before resetting anything, check for local work that only exists on your machine and hasn't been pushed anywhere else — git log origin/main..HEAD or simply reviewing git status and recent local commits. Only once you've confirmed there's nothing you'd lose, and you understand the force-push was intentional, is it safe to run git reset --hard origin/main to realign your local branch with the new remote history. If there is unpushed work worth keeping, branch off it first (git branch backup-branch) before resetting, so it's recoverable either way.What interviewers look for
- fetches first rather than blindly pulling again
- inspects what changed before acting, not assuming the cause
- explicitly checks for unpushed local work before any --hard reset, and protects it if found
Likely follow-up: How would
git bisect help if the force-push also introduced a regression you now need to track down?You need to add a mandatory security scan step to 50 services' pipelines without hand-editing 50 separate pipeline files. How do you design this?
The right shape is a shared, versioned library or template that centralizes the common step, referenced from each individual pipeline rather than duplicated into it. Add the scan step once to that shared library, cut a new version of it, and each consuming pipeline either picks it up automatically on its next run (if it references the library by a floating branch) or needs its reference bumped to the new version (if pinned to an explicit tag) — pinning is the safer default precisely because it means a bad change to the shared library doesn't instantly break all 50 pipelines simultaneously. For the rollout itself, treat it like any other risky change: roll it out to a small subset of services first, confirm the scan step behaves correctly and doesn't produce false-positive failures, then widen it gradually rather than bumping all 50 references at once. The alternative — manually editing 50 separate files — is exactly the maintenance burden this shared-library pattern exists to eliminate, and it also guarantees the next required change becomes 50 edits again.
What interviewers look for
- centralizes the step in one versioned shared library/template rather than copy-pasting it 50 times
- explains the pinned-vs-floating version tradeoff and why pinning is the safer default for a risky shared change
- describes a staged rollout to a subset first, not flipping all 50 pipelines simultaneously
Likely follow-up: How would you roll this back quickly if the scan step starts breaking pipelines after you've widened the rollout?
A teammate says 'Kubernetes doesn't use Docker anymore.' What's true here, and does it mean Docker itself is obsolete?
True, but only in one narrow sense: newer Kubernetes releases dropped dockershim, the compatibility layer that let kubelet talk to the Docker daemon through Kubernetes' Container Runtime Interface. With that shim gone, kubelet now talks directly to a CRI-compliant runtime such as containerd or CRI-O, and the Docker daemon on the node is out of that path entirely. None of that retires Docker as a tool — day to day, people keep building images and running local dev environments with it, and containerd itself has always been what Docker runs on internally, so the engine doing the work hasn't really changed, only which layer Kubernetes now calls directly. Keep two separate ideas apart: Docker the build and local-development tool is untouched by any of this, while the Docker daemon as a cluster's runtime for executing containers is what disappears on nodes running a different CRI runtime.
What interviewers look for
- explains dockershim removal and that kubelet now talks to containerd/CRI-O directly via CRI
- clarifies Docker remains standard for building images and local development, and is not obsolete
- distinguishes 'Docker the build tool' clearly from 'Docker as the node's container runtime'
Likely follow-up: If a node is confirmed running containerd directly, what changes for someone trying to debug a container at the node level?
Pods are stuck Pending, but the Cluster Autoscaler isn't adding any new nodes. Walk through how you'd debug this.
An autoscaler only provisions a new node when its own calculation shows that node would resolve a specific pod's pending state — when it can't reach that conclusion, it simply stays idle, and nothing gets reported back on the pod itself to explain why, which is what makes this look like a malfunction rather than the system working exactly as designed. In practice the usual culprit is a scheduling requirement attached to the pod — a required node label, an affinity rule, or a taint toleration — that doesn't match anything the autoscaler is set up to create. It has no template for provisioning a node that would satisfy that requirement, so by its own logic, adding one wouldn't help, and the pod sits pending indefinitely as a result. Rather than assuming the autoscaler is broken, pull the scheduling requirement straight from
kubectl describe pod <pending-pod>'s events first, then separately confirm whether any node pool the autoscaler manages is even capable of meeting it. Only after that comes back clean is it worth checking autoscaler-specific limits like a max node cap.What interviewers look for
- explains the autoscaler only scales when it can determine a new node would let the Pod schedule
- names the common cause: a scheduling constraint no configured node pool satisfies
- starts the investigation with kubectl describe pod for the exact constraint, not a guess
Likely follow-up: The scheduling constraint checks out fine — what else can silently block the autoscaler from acting?
A node goes NotReady overnight and takes several unrelated workloads down with it. The post-mortem finds one Pod on that node had no memory limit set. Explain the failure chain, and how you'd prevent a repeat.
Without a memory limit, that one Pod was free to consume memory on the node without bound. As its usage grew, it started starving every other Pod scheduled on the same node — not just slowing them down, but eventually the node itself ran out of available memory faster than it could evict or throttle anything cleanly, and kubelet's own ability to function degraded along with everything else, which is what produced the NotReady state and took down unrelated workloads that happened to share that node. This is the classic 'noisy neighbour' problem, and QoS classes alone don't fully prevent it: a Pod with no requests or limits gets
BestEffort QoS, which does mean it's evicted first under memory pressure — but eviction only helps once the kubelet detects pressure and can act, and a sufficiently fast or large leak can exhaust node memory before that eviction protection meaningfully kicks in. The prevention is enforcing limits structurally rather than relying on every team remembering to set them: a LimitRange per namespace that applies sensible default requests/limits to any container that doesn't specify its own, paired with a ResourceQuota capping total namespace consumption.What interviewers look for
- explains the noisy-neighbour mechanism — unbounded memory use by one Pod starving others on the same node
- correctly notes BestEffort QoS alone doesn't fully prevent this, since eviction can be too slow for a fast/large leak
- names the structural prevention: LimitRange defaults plus ResourceQuota enforced per namespace, not relying on convention
Likely follow-up: Why doesn't BestEffort QoS alone fully solve this?
Terraform tries to create a resource and fails because it already exists in the cloud account — but it isn't in Terraform's state. How did this likely happen, and how do you bring it under Terraform's management safely?
This almost always means the resource was created outside Terraform's knowledge at some point — provisioned manually through a console, created by a different tool or script, or left behind after a previous state file was lost or reset without the underlying resource being destroyed along with it. The fix is
terraform import (or, in newer workflows, an import block defined directly in configuration), which associates the existing real resource with a resource address in Terraform's state without recreating it. Importing alone isn't the end of the job, though: immediately after, run terraform plan and expect to see zero changes — if the plan instead shows a diff, that means the configuration in code doesn't fully match the real resource's current settings, and that gap needs to be reconciled in the configuration before trusting Terraform to manage it going forward, otherwise the very next apply could silently change settings nobody intended to touch. Beyond fixing this one resource, it's worth treating the discovery itself as a signal — if resources are being created outside Terraform, that's a process gap worth closing, since it can recur with the next resource just as easily.What interviewers look for
- explains the resource was most likely created outside Terraform's knowledge (manual console, other tooling, or lost state)
- names terraform import (or an import block) as the mechanism, not recreating the resource
- stresses running plan afterward and expecting zero diff before trusting the import, not treating import alone as done
Likely follow-up: What would make you suspect this is ongoing drift rather than a one-time mismatch?
During an outage, on-call gets paged separately for 'service down' and 'high latency' on the same service within seconds of each other. How would you reduce this kind of alert noise using Alertmanager, without just muting the alerts?
Two distinct Alertmanager features address this without hiding any real signal. Grouping bundles related firing alerts that match a shared set of labels into a single notification instead of sending one page per alert — so instead of two separate pages for the same underlying outage arriving seconds apart, on-call gets one notification covering both. Inhibition goes further: it actively suppresses a lower-severity alert when a related, higher-severity alert is already firing, on the reasoning that the lower-severity one is very likely just a downstream symptom of the same root cause — 'high latency' firing on a service that's already firing 'service down' is a textbook case, since a fully down service will obviously also show high (or infinite) latency, and paging for both separately adds noise without adding information. The key distinction from simply muting alerts is that both mechanisms are conditional on the alert state: as soon as the higher-severity alert clears, the inhibited one is free to fire again if it's still a problem, so nothing gets permanently silenced the way a manual mute would.
What interviewers look for
- explains grouping bundles related firing alerts into one notification instead of one per alert
- explains inhibition suppresses a lower-severity symptom alert while a related higher-severity cause alert is firing
- distinguishes this from simply muting/silencing, since both mechanisms are conditional on current alert state
Likely follow-up: What's the risk of over-using inhibition rules across many alert types?
You're the incident commander on a P1, and engineering wants more time to investigate the root cause before committing to a mitigation. How do you handle this?
As incident commander, the role isn't to personally debug the problem — it's to coordinate the response and make the call on mitigation, which sometimes means deciding to act before the root cause is fully understood. Waiting for complete certainty during an active customer-facing outage has a real cost: every minute spent purely investigating is a minute of continued impact, and in many cases a reasonable mitigation (rolling back a recent deploy, failing over to a known-good path, shedding non-critical load) can stop the bleeding without requiring the root cause to be nailed down first. The job is weighing that tradeoff explicitly rather than defaulting to either extreme — mitigating blindly without any understanding, or refusing to act until everything is understood — and making a defensible call given what's known right now. Equally important is setting a clear communication cadence during this: stakeholders and the rest of the responding team need regular timeline updates regardless of whether a decision has been made yet, so the incident doesn't go silent while a decision is being weighed.
What interviewers look for
- frames the IC's role as coordination and decision-making, not personally solving the technical problem
- explains why waiting for full certainty during a live customer-facing outage has a real ongoing cost
- sets or maintains a clear communication cadence rather than going quiet while the decision is being made
Likely follow-up: How do you balance 'mitigate now' against the risk that an early mitigation makes the later root-cause investigation harder?
During a live incident, an AI assistant produces a confident, well-written root-cause summary from the logs. As incident commander, how much do you trust it, and what do you still verify yourself before acting on it?
Treat it as a lead worth investigating quickly, not as a verified root cause to act on directly — a fluent, confident-sounding explanation is not, by itself, evidence that it's accurate, and during a live incident is exactly when the cost of checking is cheapest relative to the cost of acting on something wrong. The concrete verification before any destructive or customer-facing mitigation is tracing the summary back to the primary signal it claims to summarize: the real log lines, the real metrics, the real timeline — not just accepting the summary of them. This matters more, not less, under incident time pressure, because the instinct to skip verification and move fast is strongest exactly when a wrong mitigation is most costly — rolling back the wrong deploy, or failing over the wrong component, based on an unverified summary can extend the outage rather than end it. None of this means the summary is useless; it can speed up finding the right logs and metrics to check. The discipline is using it to accelerate the investigation, not to replace it.
What interviewers look for
- treats the AI summary as a lead to verify, not a verified conclusion to act on directly
- verifies against the primary signal (real logs/metrics/timeline) before any destructive or customer-facing action
- explains why incident time pressure makes skipping verification more tempting and also more costly if wrong, not less important
Likely follow-up: The AI summary turns out to have been right, but it was never asked to double-check itself — does that change how much you trust it next time?

