HireHireInterview Quizzes › DevOps / SRE Engineer

DevOps / SRE Engineer Interview Questions

Think you're ready? These are the questions that actually decide DevOps / SRE Engineer interviews. Warm up on Easy — then face the Hard round, where 95% of candidates crumble. 80 questions across 3 levels, instant score, completely free.

80Questions
3Difficulty levels
95%Fail the hard round
FreeInstant score
Easy
Warm-up · 20 Qs
Medium
Practical · 30 Qs
Hard
Brutal · 30 Qs
⚡ Take the DevOps / SRE Engineer quiz — get your score →

The DevOps / SRE Engineer interview questions

Below are the real questions, grouped by difficulty. Expand any one to reveal the correct answer and why — or take the timed quiz for a score you can share. Can you clear the Hard round?

Easy round 20 questions

You run `docker run myimg` and the container exits at once; `docker ps` is empty but `docker ps -a` shows it Exited (0). What most likely happened?
  • A. The image failed to download from the registry
  • B. The main process ran to completion and there is no long-lived foreground process ✓
  • C. The host ran out of memory and killed it
  • D. A port it needed was already in use
Correct answer: B. A container lives only as long as its PID 1 foreground process; exit 0 means that process simply finished normally.
A pod shows status CrashLoopBackOff. What is Kubernetes telling you?
  • A. The pod cannot be scheduled onto any node
  • B. The image tag does not exist in the registry
  • C. The container repeatedly starts, crashes, and is restarted with growing back-off delays ✓
  • D. The pod is waiting for a persistent volume to bind
Correct answer: C. CrashLoopBackOff means the container keeps exiting and the kubelet restarts it with an increasing back-off interval.
To graph the per-second request rate from a Prometheus counter, which expression do you use?
  • A. sum() over the counter
  • B. increase() with no time window
  • C. rate() applied to a range vector of the counter ✓
  • D. avg_over_time() of the counter
Correct answer: C. rate() over a range vector computes the per-second average increase of a counter and handles resets correctly.
An SLO promises 99.9% availability per 30-day month. Roughly how much downtime does that allow?
  • A. About 4.3 minutes per month
  • B. About 43 minutes per month ✓
  • C. About 7.2 hours per month
  • D. About 8.7 hours per month
Correct answer: B. 0.1% of ~43,200 minutes in a month is about 43 minutes of allowed downtime.
In a shell, when does cmd2 run in `cmd1 && cmd2`?
  • A. cmd2 runs only if cmd1 exits with status 0 ✓
  • B. cmd2 runs only if cmd1 exits non-zero
  • C. Both always run in parallel
  • D. cmd2 runs regardless of cmd1's exit status
Correct answer: A. `&&` is logical AND: cmd2 executes only when cmd1 succeeds (exit code 0).
After `chmod 644 file`, who can do what?
  • A. Owner read/write/execute; group and others read
  • B. Owner read/write; group and others read only ✓
  • C. Everyone read/write
  • D. Owner read only; group and others read/write
Correct answer: B. 6=rw- for owner, 4=r-- for group, 4=r-- for others.
You committed to the wrong branch but haven't pushed. What does `git reset --soft HEAD~1` do?
  • A. Deletes the last commit and discards its changes permanently
  • B. Removes the last commit but keeps its changes staged in the index ✓
  • C. Creates a new commit that reverses the last one
  • D. Pushes a revert to the remote branch
Correct answer: B. A soft reset moves HEAD back one commit while leaving the changes staged so you can recommit them elsewhere.
In a Dockerfile you `COPY . .` before `RUN npm install`. Why does this hurt build times?
  • A. It has no effect on caching
  • B. It reduces the final image size
  • C. Any source change invalidates the cache so dependencies reinstall every build ✓
  • D. It makes npm install run faster
Correct answer: C. Copying all source first busts the layer cache on every code edit, forcing the expensive install step to rerun.
A pod's readiness probe starts failing. What happens?
  • A. The pod is deleted and rescheduled
  • B. The container is restarted immediately
  • C. The pod is removed from the Service endpoints so it stops receiving traffic ✓
  • D. The node is cordoned
Correct answer: C. A failing readiness probe pulls the pod out of Service endpoints without restarting the container.
In contrast, what happens when a pod's liveness probe fails?
  • A. The container is restarted ✓
  • B. The pod is removed from Service endpoints but keeps running
  • C. The deployment is rolled back
  • D. Nothing; it only logs a warning
Correct answer: A. A failing liveness probe tells the kubelet the container is unhealthy, so it kills and restarts it.
`terraform plan` shows a resource marked `-/+`. What does that mean?
  • A. The resource will be updated in place
  • B. The resource will be destroyed and recreated (replaced) ✓
  • C. The resource is unchanged
  • D. The resource will only be imported
Correct answer: B. `-/+` denotes replacement: Terraform will destroy the existing resource and create a new one.
Why lower a DNS record's TTL a day before migrating a service to a new IP?
  • A. It increases how long resolvers cache the old record
  • B. It makes resolvers pick up the new record sooner after the change ✓
  • C. It encrypts the DNS response
  • D. It load-balances between records
Correct answer: B. A shorter TTL means caches expire quickly, so clients see the new IP faster during cutover.
An nginx reverse proxy returns HTTP 502 to clients. What does that typically indicate?
  • A. The client sent a malformed request
  • B. The requested URL was not found
  • C. The upstream backend was unreachable or returned an invalid response ✓
  • D. The client is not authenticated
Correct answer: C. 502 Bad Gateway means the proxy got no valid response from the upstream server.
How often does a cron job with schedule `*/15 * * * *` run?
  • A. At 15 minutes past every hour, once
  • B. Every 15 minutes ✓
  • C. Every 15 hours
  • D. On the 15th of every month
Correct answer: B. `*/15` in the minutes field fires at minute 0, 15, 30, and 45 of every hour.
What is the main operational advantage of a blue-green deployment?
  • A. It uses fewer servers than rolling deployment
  • B. Traffic can be switched back to the old environment for near-instant rollback ✓
  • C. It requires no load balancer
  • D. It deploys gradually pod by pod
Correct answer: B. The old (blue) environment stays intact, so rollback is just repointing traffic back to it.
A systemd-managed service is misbehaving and you need its logs. Which command shows them?
  • A. cat /var/log/service
  • B. systemctl logs service
  • C. journalctl -u service ✓
  • D. dmesg | grep service
Correct answer: C. `journalctl -u <unit>` shows the journal entries for that specific systemd service.
You bake an API secret into a Docker image as a plaintext ENV instruction. Why is this a problem?
  • A. It is encrypted automatically by Docker
  • B. It is stored in the image layers and readable via docker history/inspect ✓
  • C. It is only visible to root inside the container
  • D. It disappears when the container stops
Correct answer: B. ENV values are persisted in image layers and exposed by `docker history`/`inspect`, leaking the secret to anyone with the image.
A HorizontalPodAutoscaler targets 50% CPU. You have 4 pods each pinned at 100% CPU. Roughly what does it scale to?
  • A. It scales to about 2 pods
  • B. It stays at 4 pods
  • C. It scales to about 8 pods ✓
  • D. It scales to about 16 pods
Correct answer: C. desired = ceil(4 × 100/50) = 8 pods to bring average utilization down to the 50% target.
Why do standard DNS lookups use UDP by default rather than TCP?
  • A. UDP guarantees delivery of large records
  • B. Small queries avoid TCP's connection-setup overhead ✓
  • C. UDP encrypts the query
  • D. TCP is not allowed for DNS at all
Correct answer: B. Most queries fit in one small packet, so UDP skips the handshake and is faster; TCP is used as a fallback.
A newly created pod is stuck in Pending. What is the most common cause?
  • A. The container's process crashed on start
  • B. No node has enough allocatable resources to schedule it ✓
  • C. The liveness probe is failing
  • D. The image entrypoint exited 0
Correct answer: B. Pending usually means the scheduler can't place the pod, often due to insufficient CPU/memory or node constraints.

Medium round 30 questions

A container in your Kubernetes deployment keeps restarting, and `kubectl get pods` shows status `CrashLoopBackOff`. Which command is the most direct first step to find out why the container is failing?
  • A. kubectl describe node <node-name>
  • B. kubectl logs <pod-name> --previous ✓
  • C. kubectl rollout restart deployment/<name>
  • D. kubectl scale deployment/<name> --replicas=0
Correct answer: B. `kubectl logs --previous` shows the logs from the last terminated container instance, which usually contains the error that caused the crash.
In a Dockerfile, you notice that changing one line of application source code causes the entire `RUN npm install` step to re-run on every build. What is the correct fix to leverage layer caching?
  • A. Combine COPY and RUN into a single instruction
  • B. Copy package.json/package-lock.json and run npm install before copying the rest of the source ✓
  • C. Add --no-cache to the docker build command
  • D. Move the RUN npm install to the last line of the Dockerfile
Correct answer: B. Copying only the dependency manifest first lets Docker cache the install layer, so it only re-runs when dependencies actually change, not on every source edit.
Your service's SLO is 99.9% availability over 30 days. Roughly how much total downtime does the corresponding error budget allow in that period?
  • A. About 43 minutes ✓
  • B. About 4.3 minutes
  • C. About 7 hours
  • D. About 22 minutes
Correct answer: A. 99.9% of 30 days (43,200 minutes) leaves a 0.1% error budget, which is about 43 minutes of allowed downtime.
You need to give a Kubernetes pod read-only access to a database password without baking it into the image or the pod spec in plaintext. Which is the most appropriate native mechanism?
  • A. Set it as a plaintext environment variable in the Deployment YAML
  • B. Store it in a ConfigMap and mount it as a volume
  • C. Store it in a Secret and reference it via envFrom or a mounted volume ✓
  • D. Hardcode it in the container's ENTRYPOINT script
Correct answer: C. Kubernetes Secrets are the built-in resource for sensitive data and can be injected as env vars or mounted files, unlike ConfigMaps which are for non-sensitive config.
In a Terraform workflow, a teammate ran `terraform apply` and now the state file shows resources you don't have locally. What is the primary purpose of using a remote backend with state locking (e.g. S3 + DynamoDB)?
  • A. To automatically format .tf files on save
  • B. To prevent concurrent applies from corrupting shared state and to share state across the team ✓
  • C. To encrypt the Terraform provider binaries
  • D. To replace the need for terraform plan
Correct answer: B. Remote backends with locking give a single shared source of truth for state and prevent two people from applying simultaneously and corrupting it.
A Prometheus alert fires whenever CPU briefly spikes for a few seconds during normal cron jobs, creating noise. Which change best reduces these false-positive alerts?
  • A. Lower the CPU threshold in the alert expression
  • B. Add a `for:` duration so the condition must hold for a sustained period before firing ✓
  • C. Increase the Prometheus scrape interval to 5 minutes
  • D. Delete the alerting rule entirely
Correct answer: B. The `for` clause requires the alert condition to remain true for a specified duration, filtering out short transient spikes.
You're deploying a new version and want zero downtime, with the ability to instantly switch back if the new version fails. Which deployment strategy matches this description?
  • A. Recreate deployment
  • B. Blue-green deployment ✓
  • C. In-place upgrade
  • D. Big-bang deployment
Correct answer: B. Blue-green runs the new version alongside the old, switching traffic over at once and allowing an instant rollback by switching traffic back.
A colleague runs `chmod 777` on a deployment script to 'fix a permission error.' From a security standpoint, why is this generally the wrong fix?
  • A. 777 makes the file read-only for everyone
  • B. 777 grants read, write, and execute to all users, which is overly permissive and a security risk ✓
  • C. 777 only affects the owner, so it changes nothing
  • D. chmod cannot be used on scripts, only chown
Correct answer: B. 777 gives everyone full read/write/execute access, so a more restrictive permission like 755 or 750 should be used to follow least privilege.
In a CI pipeline, your integration tests pass locally but intermittently fail in CI with 'connection refused' when talking to a database container that starts alongside the tests. What is the most likely cause?
  • A. The CI runner has insufficient disk space
  • B. The tests start before the database is fully ready to accept connections (missing readiness/wait check) ✓
  • C. The database image is corrupted
  • D. CI does not support networking between containers
Correct answer: B. A race condition where tests run before the DB finishes initializing is the classic cause; adding a health/readiness wait before running tests fixes it.
You want a Linux service to automatically restart if it crashes and to start on boot. Which is the standard modern approach on most current Linux distributions?
  • A. Add an entry to /etc/crontab that pings the process every minute
  • B. Create a systemd unit file with Restart=on-failure and enable it ✓
  • C. Run the process in a screen session as root
  • D. Put a while-true loop in .bashrc
Correct answer: B. systemd is the standard init/service manager; a unit with Restart=on-failure handles crash recovery and `systemctl enable` handles boot startup.
A Kubernetes Pod repeatedly restarts and 'kubectl describe' shows 'CrashLoopBackOff'. Which is the MOST likely cause to investigate first?
  • A. The Service selector is wrong
  • B. The container process exits or errors on startup ✓
  • C. The Ingress controller is down
  • D. The node has a taint
Correct answer: B. CrashLoopBackOff means the container keeps exiting shortly after starting, so the startup command or app crash is checked first.
In the four golden signals of SRE monitoring, which set is correct?
  • A. Latency, Traffic, Errors, Saturation ✓
  • B. CPU, Memory, Disk, Network
  • C. Uptime, Downtime, MTTR, MTBF
  • D. Requests, Responses, Retries, Rollbacks
Correct answer: A. Google's four golden signals are Latency, Traffic, Errors, and Saturation.
You want a Deployment to update pods gradually so some old and new pods run simultaneously with no downtime. Which strategy does this by default?
  • A. Recreate
  • B. RollingUpdate ✓
  • C. Blue-Green
  • D. Canary
Correct answer: B. RollingUpdate is the default Deployment strategy that incrementally replaces old pods with new ones.
In Prometheus, which metric type is monotonically increasing and typically used with rate() to measure per-second request rates?
  • A. Gauge
  • B. Counter ✓
  • C. Histogram
  • D. Summary
Correct answer: B. A Counter only increases or resets to zero, and rate() over a counter gives per-second rates.
Terraform reports it will destroy and recreate a resource you only wanted to modify in place. What most commonly forces this?
  • A. Running terraform fmt
  • B. Changing an argument marked as ForceNew/immutable ✓
  • C. A missing provider block
  • D. Using a data source
Correct answer: B. Changing an attribute that the provider marks as ForceNew forces resource replacement rather than an in-place update.
Which SSH configuration change most effectively reduces brute-force login risk on a production Linux server?
  • A. Change the shell to zsh
  • B. Disable password authentication and use key-based auth ✓
  • C. Increase MaxSessions
  • D. Enable X11 forwarding
Correct answer: B. Disabling password auth and requiring SSH keys eliminates password-guessing brute-force attacks.
In a CI/CD pipeline, what is the main benefit of running each job in an ephemeral, containerized agent?
  • A. It permanently caches all dependencies
  • B. It guarantees a clean, reproducible environment per run ✓
  • C. It removes the need for version control
  • D. It disables test execution
Correct answer: B. Ephemeral containerized agents give each run a fresh, reproducible environment free of leftover state.
A service's p99 latency spikes while p50 stays flat. What does this most likely indicate?
  • A. All requests got slower uniformly
  • B. A subset of requests (the tail) is slow, e.g., due to GC pauses or a slow shard ✓
  • C. The service is completely down
  • D. Traffic dropped to zero
Correct answer: B. A high p99 with a stable p50 means only the tail of requests is slow, pointing to intermittent issues like GC, locking, or a hot shard.
In Kubernetes, what does setting a container's resource 'requests' primarily affect?
  • A. The maximum memory before OOMKill
  • B. Scheduling: how much capacity the scheduler reserves on a node ✓
  • C. The container's restart policy
  • D. The image pull policy
Correct answer: B. Requests are used by the scheduler to decide node placement by reserving that much capacity.
You must store a database password used by pods without committing it to Git in plaintext. Which native Kubernetes object is intended for this?
  • A. ConfigMap
  • B. Secret ✓
  • C. Annotation
  • D. Label
Correct answer: B. Secrets are designed to hold sensitive data like passwords and can be encrypted at rest in etcd.
A Kubernetes pod is stuck in CrashLoopBackOff. Which is the most direct first step to diagnose the cause?
  • A. Delete the namespace
  • B. Run kubectl logs on the pod (including --previous) ✓
  • C. Scale the deployment to zero
  • D. Restart the kubelet on every node
Correct answer: B. kubectl logs (with --previous for the crashed container) shows why the container keeps exiting.
In a Kubernetes Service, what does type ClusterIP provide?
  • A. An external public IP via the cloud provider
  • B. A stable internal-only virtual IP reachable within the cluster ✓
  • C. A host port on every node
  • D. Direct pod IP exposure to the internet
Correct answer: B. ClusterIP exposes the Service on an internal virtual IP that is only reachable from inside the cluster.
You want a Docker container's data to persist after the container is removed. What should you use?
  • A. A named volume or bind mount ✓
  • B. The container's writable layer
  • C. An ENV variable
  • D. A larger base image
Correct answer: A. Volumes and bind mounts store data outside the container's ephemeral writable layer so it survives removal.
In Prometheus, which metric type is best suited for a value that can go up and down, such as current memory usage?
  • A. Counter
  • B. Gauge ✓
  • C. Histogram
  • D. Summary
Correct answer: B. A Gauge represents a value that can increase and decrease, ideal for current memory or temperature.
What is the effect of a Kubernetes readinessProbe failing on a pod?
  • A. The pod is immediately deleted
  • B. The container is restarted
  • C. The pod is removed from Service endpoints until it passes again ✓
  • D. The node is cordoned
Correct answer: C. A failing readiness probe removes the pod from Service load-balancing endpoints without restarting it.
In a blue-green deployment, how is traffic typically cut over to the new version?
  • A. Gradually shifting a small percentage of users over hours
  • B. Switching the router/load balancer from the old environment to the new one at once ✓
  • C. Rebuilding all servers in place
  • D. Only after DNS TTL expires globally with no control
Correct answer: B. Blue-green flips traffic from the old (blue) to the new (green) environment in one switch, enabling fast rollback.
Which Terraform concept records the real-world resources it manages so it can detect drift?
  • A. Provider
  • B. State file ✓
  • C. Module
  • D. Backend lock only
Correct answer: B. The Terraform state file maps configuration to real resources and lets Terraform detect drift.
In an nginx reverse proxy, which directive passes the original client IP to the backend?
  • A. proxy_pass
  • B. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ✓
  • C. add_header Cache-Control
  • D. rewrite ^/ /index
Correct answer: B. Setting X-Forwarded-For with $proxy_add_x_forwarded_for forwards the client's real IP to upstream servers.
A CI pipeline builds the same Docker image on every commit but is very slow. Which change most improves build speed?
  • A. Disable the cache entirely
  • B. Order Dockerfile layers so rarely-changing steps come first and leverage layer caching ✓
  • C. Use a larger base image
  • D. Combine every command into one RUN with no caching
Correct answer: B. Placing stable steps early lets Docker reuse cached layers, so only changed layers rebuild.
In AWS, what is the main difference between a security group and a network ACL?
  • A. Security groups are stateless; NACLs are stateful
  • B. Security groups are stateful and instance-level; NACLs are stateless and subnet-level ✓
  • C. Both are stateless and subnet-level
  • D. Security groups only control outbound traffic
Correct answer: B. Security groups are stateful and attach to instances, while NACLs are stateless and operate at the subnet level.

Hard round 30 questions

A 3-node StatefulSet (Cassandra) runs one pod per node. Node-2 suddenly loses network connectivity and its kubelet stops reporting. After the node goes NotReady, an operator notices the pod for node-2 stays in `Terminating` indefinitely and no replacement pod is created on a healthy node. Why does Kubernetes deliberately NOT reschedule this StatefulSet pod automatically?
  • A. The StatefulSet controller lacks a pod-eviction reconciler, so only Deployments auto-reschedule on node failure
  • B. The API server cannot confirm the old pod is truly gone; creating a same-identity replacement risks two pods with the same stable identity/volume, so it waits for confirmed deletion (force-delete or node removal) ✓
  • C. PodDisruptionBudget blocks the eviction because minAvailable is set to 3
  • D. The default-scheduler has no other node with sufficient CPU, so the pod stays Pending as Terminating
Correct answer: B. For StatefulSets a partitioned/unreachable node's pod is only marked Terminating; Kubernetes will not create a replacement with the same identity until deletion is confirmed, to avoid split-brain on the stable network ID and volume.
A pod has `requests.memory: 256Mi` and `limits.memory: 512Mi`. Under a memory-pressure event the node's kernel OOM killer fires and this pod's container is killed (exit 137) even though it was using ~300Mi, while a neighboring pod using 1Gi survived. The neighbor has `requests.memory: 1Gi, limits.memory: 1Gi`. What best explains the kernel's choice?
  • A. The neighbor was killed first but restarted faster, so it appears to have survived
  • B. The OOM killer always kills the pod with the highest absolute RSS, so the 300Mi pod should not have died
  • C. Guaranteed QoS (requests==limits) pods get a lower oom_score_adj, while Burstable pods exceeding their requests get a higher oom_score_adj, making the Burstable pod a preferred kill target ✓
  • D. cgroup v2 disables per-container OOM scoring, so kills are purely random across the node
Correct answer: C. Kubernetes sets oom_score_adj by QoS class; Guaranteed pods are most protected while Burstable pods using memory above their request receive a higher (worse) score, so they are killed first under node pressure regardless of absolute usage.
Your service has a 99.9% availability SLO over a 30-day window. Multi-window multi-burn-rate alerting uses a fast page when a 1-hour burn rate is high AND a 5-minute burn rate confirms it. If you page at a burn rate of 14.4, roughly how much of the 30-day error budget would be consumed in that 1-hour window if the burn continued, and why is the 14.4 threshold chosen?
  • A. About 2% of the budget; 14.4 is chosen because it equals 1000 minutes of downtime
  • B. About 2% of the budget; 14.4x burn over 1 hour spends ~2% of a 30-day budget, giving a fast but still-meaningful page while the short second window suppresses spikes ✓
  • C. About 50% of the budget; 14.4 corresponds to burning half the month in one hour
  • D. About 0.1% of the budget; 14.4 is simply 99.9 divided by 6.9
Correct answer: B. A 14.4x burn rate consumes ~2% of the monthly budget in one hour (14.4 x (1h/720h) ≈ 2%), the canonical Google SRE fast-burn threshold, with a short secondary window to avoid alerting on transient spikes.
Two engineers run `terraform apply` against the same S3-backed state with DynamoDB locking. Engineer A's apply crashes (laptop dies) mid-write. Engineer B now gets `Error acquiring the state lock` on every command. What is the correct and safest recovery?
  • A. Run `terraform force-unlock <LOCK_ID>` after confirming A's process is dead and no apply is in flight, then re-plan to check state consistency ✓
  • B. Delete the DynamoDB lock table so future runs never lock again
  • C. Run `terraform apply -lock=false` immediately to bypass the stuck lock
  • D. Manually edit terraform.tfstate in S3 to remove the lock field, then apply
Correct answer: A. The lock is a DynamoDB item, not part of state JSON; after verifying no apply is actually running you use `terraform force-unlock <ID>` and re-plan, whereas disabling locking or deleting the table invites concurrent-write corruption.
A 3-node etcd cluster backs your Kubernetes control plane. One etcd member's disk fills and it starts returning slow/failed writes. You observe API server latency spikes and some writes failing, but reads mostly work. Why does losing (or degrading) just ONE of THREE members cause write problems, and what is the quorum math?
  • A. Three members need all 3 for any write (quorum = N); losing one halts all writes
  • B. Quorum is majority = 2 of 3; the cluster can tolerate 1 full failure, but a degraded (slow-but-alive) member can stall the Raft leader's commit latency and cause write timeouts even with quorum technically available ✓
  • C. etcd uses primary-backup, so the single degraded node is the leader and no failover is possible
  • D. Reads require quorum but writes do not, which is why reads fail and writes succeed
Correct answer: B. Quorum for 3 members is 2, so one dead member is tolerable, but a slow-but-alive member can drag down Raft commit latency and leader elections, producing write timeouts even though a bare majority exists.
You must implement a token-bucket rate limiter (capacity C, refill rate R tokens/sec) that allows bursts up to C and is checked on every request. Which implementation correctly refills lazily without a background timer and handles bursts?
  • A. On each request, set tokens = min(C, R); if tokens >= 1 allow and decrement
  • B. On each request, compute elapsed = now - last; tokens = min(C, tokens + elapsed*R); last = now; if tokens >= 1 then tokens -= 1 and allow, else reject ✓
  • C. On each request, if request_count in the current 1-second wall-clock window < R, allow; reset counter each second
  • D. On each request, tokens += R; if tokens > 1 allow and set tokens = 0
Correct answer: B. Correct lazy token-bucket accrues tokens = min(capacity, tokens + elapsed*rate) since the last check, then spends one, which permits bursts up to C and needs no timer thread; the fixed-window counter is a different algorithm with edge-burst problems.
A microservice intermittently fails with `dial tcp: i/o timeout` connecting to an upstream, but only for payloads larger than ~1400 bytes; small requests succeed. `ping` works, DNS resolves, TCP handshake completes. Which root cause is most consistent with these symptoms?
  • A. The upstream's readiness probe is failing, dropping large requests
  • B. A path MTU / MTU mismatch (e.g., a tunnel/overlay reducing MTU) is black-holing large packets because ICMP 'fragmentation needed' is being filtered, so only sub-MTU payloads pass ✓
  • C. DNS TTL expired mid-connection, forcing re-resolution only on large payloads
  • D. The connection pool is exhausted only when payloads exceed 1400 bytes
Correct answer: B. Handshake succeeds (small packets) but large payloads hang — the classic PMTU black hole where ICMP 'fragmentation needed' is filtered, so packets above the path MTU are silently dropped.
You run Prometheus with a metric `http_requests_total{path, method, status, user_id}`. Ingestion is fine at first but after weeks Prometheus OOMs and queries slow drastically. The `user_id` label has ~2 million distinct values. What is the core problem and the correct fix?
  • A. Retention is too long; reduce retention to 7 days to fix memory
  • B. High cardinality: each unique label-set is a separate time series, so `user_id` explodes series count and index memory; remove/aggregate the unbounded label (drop user_id) or move it to logs/traces ✓
  • C. Scrape interval is too short; increase it to 5 minutes to reduce series
  • D. Prometheus needs remote_write enabled; that offloads all series memory automatically
Correct answer: B. An unbounded label like user_id multiplies the number of distinct time series (each stored/indexed separately), so the fix is to drop the high-cardinality label and put per-user detail in logs/traces, not metrics.
During an incident, retries with a fixed 1s interval from thousands of clients hitting a briefly-degraded backend cause a sustained overload that outlasts the original fault (the backend never recovers). Which combination most directly breaks this thundering-herd/retry-storm dynamic?
  • A. Increase the backend's connection timeout and add more retries
  • B. Exponential backoff WITH jitter plus a circuit breaker to stop hammering an unhealthy dependency, optionally with load shedding at the backend ✓
  • C. Switch clients to synchronous retries so they serialize naturally
  • D. Raise the client-side retry count so eventually one succeeds
Correct answer: B. Fixed-interval synchronized retries create a self-sustaining herd; exponential backoff with jitter de-synchronizes clients and a circuit breaker halts requests to an unhealthy backend so it can recover, while load-shedding protects it under overload.
You need the top-10 most frequent failing endpoints from a 200GB access log that cannot fit in memory, and you want bounded memory. Which approach is correct and memory-bounded?
  • A. Load the whole file into a hash map of endpoint->count, then sort — it's O(n) so memory is fine
  • B. Stream line-by-line, maintain a hash map keyed only by endpoint (bounded by the number of distinct endpoints, which is small) incrementing counts, then take the top 10; or use a bounded count-min sketch + heap if distinct keys are huge ✓
  • C. Sort the entire 200GB file first with an external merge sort, then scan — this is the only correct method
  • D. Sample 1% of lines randomly; the top-10 from the sample is always exactly correct
Correct answer: B. Distinct endpoints are typically bounded and small, so a streaming pass with a per-endpoint counter uses memory proportional to distinct keys (not file size); if the keyspace were huge, a count-min sketch plus a top-k heap keeps memory bounded.
A Kubernetes pod is OOMKilled repeatedly even though node memory appears free. The container limit is 512Mi. Which explanation is most accurate?
  • A. The node kernel randomly kills pods
  • B. The container's cgroup memory limit (512Mi) was exceeded, independent of node free memory ✓
  • C. requests must equal limits or pods are killed
  • D. The scheduler evicted it due to node pressure
Correct answer: B. A container's memory limit sets its cgroup limit; exceeding it triggers an OOMKill regardless of overall node free memory.
During a rolling update you notice brief 502s despite readiness probes. What is the most likely root cause of dropped in-flight requests on old pods?
  • A. Liveness probe misconfigured
  • B. No preStop hook/graceful shutdown, so the pod stops serving before it is removed from Service endpoints ✓
  • C. HPA scaled down too fast
  • D. Image digest mismatch
Correct answer: B. Without a preStop delay/graceful shutdown, a pod can stop serving on SIGTERM before endpoints are drained, dropping in-flight requests.
Your 99.9% SLO error budget is 80% consumed by mid-month. Per SRE practice, what is the appropriate action?
  • A. Immediately raise the SLO to 99.99%
  • B. Slow or freeze risky feature releases and prioritize reliability work ✓
  • C. Ignore it since the budget isn't fully spent
  • D. Delete the alerting rules
Correct answer: B. A rapidly depleting error budget signals the team should throttle risky changes and shift effort to reliability.
Two engineers run 'terraform apply' against the same remote state simultaneously without state locking. What is the primary risk?
  • A. Slower plans
  • B. State corruption/conflicting writes producing drift or lost resources ✓
  • C. Provider version conflict
  • D. Duplicate variable definitions
Correct answer: B. Concurrent writes to shared state without locking can corrupt the state file and desync it from real infrastructure.
A Prometheus query 'rate(http_requests_total[1m])' returns misleadingly low values during a spike while '[5m]' looks correct. Likely cause?
  • A. Counter reset detection failed
  • B. The scrape interval is close to the 1m window, giving too few samples for an accurate rate ✓
  • C. Histograms are not supported
  • D. The metric is a gauge
Correct answer: B. rate() needs at least two samples in the window; a short window near the scrape interval yields too few points for a reliable rate.
You must give an EKS pod temporary AWS S3 access without long-lived credentials. Which approach is recommended?
  • A. Hardcode access keys in a ConfigMap
  • B. IAM Roles for Service Accounts (IRSA) via OIDC ✓
  • C. Attach the node's instance role broadly to all pods
  • D. Store keys in an environment variable in the image
Correct answer: B. IRSA maps a Kubernetes service account to an IAM role via OIDC, giving pods scoped, short-lived credentials.
A blue-green cutover to green left a subset of users still hitting blue for several minutes. Most probable cause?
  • A. Green pods never became ready
  • B. DNS TTL or connection keep-alive caching kept routing some clients to blue ✓
  • C. The database migration failed
  • D. The load balancer was deleted
Correct answer: B. DNS TTL caching and persistent keep-alive connections can keep some clients on the old (blue) target after the switch.
In etcd, why is running an even number of members (e.g., 4) discouraged?
  • A. It doubles storage cost
  • B. It provides no better fault tolerance than the next-lower odd count and worsens quorum math ✓
  • C. etcd only supports 3 members
  • D. It disables TLS
Correct answer: B. Quorum requires a majority; an even count tolerates the same failures as the next-lower odd count while raising split-brain risk, so odd counts are preferred.
A Linux server shows high load average but low CPU utilization. Most likely explanation?
  • A. CPU is thermally throttled
  • B. Many processes are blocked in uninterruptible I/O wait (D state) ✓
  • C. Swap is disabled
  • D. The kernel is idle
Correct answer: B. Linux load average counts uninterruptible-sleep (D-state) processes, so heavy I/O wait raises load without raising CPU usage.
You enable a CPU-based HPA but pods never scale up during real overload. Which misconfiguration commonly causes this?
  • A. The Deployment has too many replicas
  • B. No CPU 'requests' are set, so HPA cannot compute a utilization percentage ✓
  • C. The image is too large
  • D. The Service is of type NodePort
Correct answer: B. CPU-based HPA computes utilization relative to the pod's CPU request; without a request it has no baseline and cannot scale.
A Kubernetes pod using a PersistentVolumeClaim with an EBS-backed StorageClass fails to schedule onto a node in another availability zone. What is the most likely cause?
  • A. The image pull secret is missing
  • B. EBS volumes are AZ-scoped, so the pod must schedule in the volume's AZ ✓
  • C. The CNI plugin is misconfigured
  • D. The readiness probe is failing
Correct answer: B. EBS volumes are bound to a single Availability Zone, so a pod using that volume can only schedule on nodes in the same AZ.
You observe that a Kubernetes Deployment rollout updates all pods at once causing downtime, despite RollingUpdate strategy. Which field most likely caused this?
  • A. maxUnavailable set to 100% (or equal to replicas) ✓
  • B. revisionHistoryLimit set too low
  • C. terminationGracePeriodSeconds too high
  • D. progressDeadlineSeconds too low
Correct answer: A. A maxUnavailable equal to the replica count lets all old pods be taken down simultaneously, causing downtime.
In Prometheus, rate() on a counter shows correct values even after a target restart resets the counter to zero. Why?
  • A. It ignores restarts entirely
  • B. rate() automatically handles counter resets by treating a decrease as a reset ✓
  • C. Counters never reset
  • D. It uses the raw delta without adjustment
Correct answer: B. Prometheus rate()/increase() detect counter resets (a drop) and compensate, so restarts don't produce false negatives.
A Terraform apply intermittently fails with a state lock error in a team using an S3 backend. What is the correct fix?
  • A. Set parallelism to 1
  • B. Enable a DynamoDB table for state locking in the backend config ✓
  • C. Delete the .terraform directory
  • D. Use terraform refresh before apply
Correct answer: B. An S3 backend needs a DynamoDB lock table to serialize concurrent state operations and prevent corruption.
Your service behind an L7 load balancer shows healthy targets but users get intermittent 502s during deploys. Which mechanism most directly prevents this?
  • A. Increasing the health check interval
  • B. Connection draining / graceful shutdown with preStop hook and matching timeouts ✓
  • C. Lowering the pod CPU request
  • D. Disabling keep-alive
Correct answer: B. Connection draining plus a preStop hook lets in-flight requests finish before the pod terminates, avoiding 502s.
In a Linux system, a process is stuck in uninterruptible sleep (state D) and cannot be killed with SIGKILL. What does this indicate?
  • A. The process is a zombie
  • B. It is blocked in a kernel I/O call, often on unresponsive storage/NFS ✓
  • C. Its niceness is too high
  • D. It is being traced by a debugger
Correct answer: B. State D means uninterruptible sleep, typically waiting on I/O; signals are deferred until the kernel call returns.
You run a multi-stage Docker build but the final image is still large. Which practice most reliably shrinks it?
  • A. Add more RUN layers
  • B. Copy only the compiled artifacts into a minimal final base image such as distroless or alpine ✓
  • C. Use ADD instead of COPY
  • D. Set WORKDIR to /
Correct answer: B. Multi-stage builds shrink images by copying only needed artifacts into a minimal final base, discarding build tooling.
A Kubernetes HorizontalPodAutoscaler is not scaling up despite high load. metrics-server is running. What is the most common misconfiguration?
  • A. The pods have no CPU/memory requests set, so utilization can't be computed ✓
  • B. The HPA minReplicas is too high
  • C. The Deployment uses RollingUpdate
  • D. The Service is of type NodePort
Correct answer: A. CPU-based HPAs compute utilization as a percentage of the request; without requests set, the HPA cannot scale.
During an incident, etcd latency spikes and the whole Kubernetes control plane slows down. Which is the most appropriate long-term mitigation?
  • A. Increase pod replica counts
  • B. Provide low-latency SSD disks and isolate etcd, keeping it well below its DB size limit ✓
  • C. Disable RBAC
  • D. Increase kube-proxy sync period
Correct answer: B. etcd is disk-latency sensitive; fast dedicated SSDs and staying under the DB size limit keep the control plane responsive.
In a GitOps workflow with a controller like Argo CD, someone manually edits a live resource with kubectl. What happens by default with auto-sync and self-heal enabled?
  • A. The change persists permanently
  • B. The controller detects drift and reverts the resource to match the Git-declared state ✓
  • C. The controller deletes the namespace
  • D. The change is committed back to Git automatically
Correct answer: B. With self-heal, the GitOps controller treats Git as the source of truth and reverts out-of-band manual changes.

Prep for another role

Questions are original, written and independently verified for HireHire's role interview quizzes. They reflect the kind of knowledge DevOps / SRE Engineer interviews test, not any specific company's questions. HireHire maps live tech & IT jobs across India, updated regularly. Last updated: August 2026.