DevOps Interview Questions and Answers

DevOps and SRE interview questions with answers: Linux, networking, CI/CD, Docker, Kubernetes, Terraform, cloud, monitoring, incidents, SLOs and practical troubleshooting scenarios.

Updated November 20, 2026 31 questions 7 min read

Key takeaways

  • DevOps interviews mix fundamentals (Linux, networking) with tooling (Docker, Kubernetes, Terraform, CI/CD).
  • Troubleshooting scenarios are central: “The site is slow. What do you check?”
  • Senior and SRE roles add reliability practices: SLOs, error budgets, incident management, postmortems.
  • Explain why you chose a tool or design, including costs and failure modes.
Contents

DevOps and SRE interviews test fundamentals, tooling and judgment under pressure. Expect conceptual questions, hands-on tasks and troubleshooting scenarios. Below are 31 common questions grouped by topic and level.

What DevOps interviews cover

Typical topic mix in a DevOps / SRE interview

Editorial estimate; SRE roles weigh reliability and coding more heavily.

4–5rounds
  • Linux and networking20%
  • CI/CD and deployments15%
  • Containers and Kubernetes25%
  • Infrastructure as code and cloud15%
  • Monitoring and incidents15%
  • Scripting or coding10%

Troubleshooting framework

  1. ScopeWho is affected, what exactly, since when? What changed recently?
  2. ObserveDashboards, logs and traces: errors, latency, saturation.
  3. HypothesizeList likely causes along the request path and rank them.
  4. MitigateRoll back, fail over, scale or disable a feature before deep debugging.
  5. Fix and learnRoot cause, a permanent fix, and a blameless postmortem.

See also system design and backend interview questions.

Linux and networking

1How do you check what is using CPU, memory and disk on a Linux server?

Junior

CPU and memory: top or htop, free -h, vmstat. Disk space: df -h, and du -sh * to find large directories. Disk I/O: iostat. Processes and open files: ps aux, lsof. Network connections: ss -tulpn.

2What happens when you type a URL into a browser?

Junior

DNS resolves the name to an IP, the browser opens a TCP connection and negotiates TLS, sends an HTTP request, the request passes through a CDN or load balancer to the application, which may query databases and caches, and the response is returned and rendered.

3TCP vs UDP?

Junior

TCP is connection-oriented with ordered, reliable delivery and congestion control (HTTP, databases). UDP is connectionless and lower-latency without delivery guarantees (DNS, video streaming, games). HTTP/3 runs over QUIC, which is built on UDP.

4How does DNS work, and what is TTL?

Mid

A resolver queries the root, the TLD servers and the authoritative server for the domain, then caches the answer for the record’s TTL. Low TTLs make changes propagate faster at the cost of more queries; lower them before a planned migration.

5A service can’t connect to a database. How do you troubleshoot?

Mid

Check DNS resolution (dig), network reachability and the port (nc -zv host 5432), firewall and security group rules, that the database is running and accepting connections, credentials and connection limits, and the application logs for the exact error.

6What is a load balancer, and Layer 4 vs Layer 7?

Mid

It distributes traffic across instances and removes unhealthy ones using health checks. L4 works with TCP/UDP connections (fast, protocol-agnostic). L7 understands HTTP, so it can route by path or host, terminate TLS and add headers.

CI/CD

7What is CI/CD?

Junior

Continuous integration merges code frequently and runs automated builds and tests on every change. Continuous delivery keeps the main branch always deployable; continuous deployment releases every change that passes the pipeline automatically.

8Describe a pipeline you would build for a web service.

Mid

On pull request: lint, unit tests, build, security scans (dependencies, secrets). On merge: build a versioned container image, push to a registry, deploy to staging, run integration and smoke tests, then deploy to production with a progressive strategy and automatic rollback on failed health checks.

9Blue-green vs canary vs rolling deployments?

Mid

Rolling: replace instances gradually. Blue-green: run the new version alongside the old and switch traffic at once, with instant rollback. Canary: send a small percentage of traffic to the new version, watch metrics and increase gradually.

10How do you manage secrets in pipelines and applications?

Mid

Never store them in code or images. Use a secrets manager (Vault, AWS Secrets Manager, cloud KMS), inject them at runtime, scope access per service, rotate them, and scan repositories for leaked secrets.

Get DevOps answer points in real time during your interview

Sottena listens to the interviewer, detects each question and shows short answer points in about a second. 150 free credits, no card required.

Containers

11Container vs virtual machine?

Junior

A VM virtualizes hardware and runs a full operating system. A container shares the host kernel and isolates processes with namespaces and cgroups, so it starts faster and uses fewer resources, but with weaker isolation.

12How do you write a good Dockerfile?

Mid

Use a small, pinned base image, multi-stage builds to keep build tools out of the final image, order layers so dependencies are cached before source code, run as a non-root user, and add a .dockerignore.

FROM golang:1.24 AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /app ./cmd/server

FROM gcr.io/distroless/static
COPY --from=build /app /app
USER nonroot
ENTRYPOINT ["/app"]

13CMD vs ENTRYPOINT?

Mid

ENTRYPOINT defines the executable that always runs; CMD provides default arguments that can be overridden. A common pattern is ENTRYPOINT ["app"] with CMD ["--port", "8080"].

Kubernetes

14What are Pods, Deployments and Services?

Junior

A Pod is one or more containers scheduled together. A Deployment manages replicas of pods and rolling updates. A Service gives a stable network name and load balances across pods. An Ingress or Gateway exposes HTTP routes from outside the cluster.

15Liveness vs readiness vs startup probes?

Mid

Readiness decides whether a pod receives traffic. Liveness restarts a container that is stuck. Startup delays the other probes for slow-starting apps. A common mistake is a liveness probe that checks external dependencies, which causes restart storms when a database is down.

16A pod is in CrashLoopBackOff. How do you debug it?

Mid

kubectl describe pod for events and exit codes, kubectl logs --previous for the last crash, check configuration and secrets, resource limits (an exit code of 137 often means OOMKilled), probes that fail too early, and image or command errors.

17Requests vs limits?

Mid

Requests are what the scheduler reserves and guarantees. Limits are the maximum: exceeding the memory limit kills the container, exceeding the CPU limit throttles it. Set requests from real usage, and be careful with tight CPU limits on latency-sensitive services.

18How do you autoscale workloads in Kubernetes?

Senior

The Horizontal Pod Autoscaler adds pods based on CPU, memory or custom metrics such as queue length; the cluster autoscaler (or Karpenter) adds nodes when pods can’t be scheduled. Scaling depends on accurate requests, fast startup and graceful shutdown.

Infrastructure as code and cloud

19What is infrastructure as code?

Junior

Defining infrastructure in version-controlled files instead of manual changes, so it is reviewable, repeatable and auditable. Terraform and OpenTofu are declarative and multi-cloud; Pulumi uses general-purpose languages; Ansible focuses on configuration.

20What is Terraform state, and how do you manage it in a team?

Mid

State maps your configuration to real resources. Store it remotely (an S3 bucket or Terraform Cloud) with locking to prevent concurrent changes, restrict access because it can contain secrets, and split state by environment or component to limit the blast radius.

21How do you design a highly available web application in the cloud?

Mid

Run stateless instances across several availability zones behind a load balancer with autoscaling, use a managed database with a standby replica in another zone, put static assets on a CDN, back up data and test restores, and define health checks and alerts.

22How do you reduce cloud costs?

Senior

Measure first with tagging and cost reports. Then right-size instances, use autoscaling and scheduling for non-production environments, buy commitments for steady workloads, use spot instances where interruptions are acceptable, clean up unused resources, and watch data transfer costs.

Monitoring and reliability

23Metrics vs logs vs traces?

Junior

Metrics are numeric time series, cheap to store and good for alerting (Prometheus). Logs are detailed event records for investigation. Traces follow one request across services to find where time is spent (OpenTelemetry). Together they form observability.

24What should you alert on?

Mid

Symptoms that affect users: error rate, latency and availability (the “golden signals” plus saturation), ideally tied to SLOs. Avoid alerting on every cause (CPU at 80%); noisy alerts lead to alert fatigue. Every alert should be actionable.

25SLI vs SLO vs SLA, and what is an error budget?

Mid

An SLI is a measurement (share of successful requests). An SLO is the target (99.9% over 30 days). An SLA is a contract with consequences. The error budget is the allowed unreliability (0.1%); when it is spent, the team prioritizes reliability over new features.

26Walk me through how you handle a production incident.

Senior

Acknowledge and assess impact, assign roles (incident lead, communications), communicate status early, mitigate first (roll back, fail over, scale) before finding the root cause, then resolve, write a blameless postmortem with timeline and root causes, and track the follow-up actions.

Troubleshooting scenarios

27The website is slow. What do you check?

Mid

Scope it: all users or some, all pages or one, since when? Check recent deploys, dashboards for latency, errors and saturation, then follow the request path: CDN, load balancer, application (CPU, memory, GC, thread pools), database (slow queries, locks, connections) and external dependencies. Traces show where the time goes.

28A disk is full on a production server. What do you do?

Mid

Find what is growing (du -sh /* | sort -h), free space safely (rotate or compress logs, clear caches, remove old images with docker system prune carefully), check for deleted files still held open (lsof | grep deleted), then fix the root cause with log rotation and disk alerts.

29A deployment caused errors for 5% of users. What do you do?

Senior

Mitigate first: roll back or shift traffic away from the new version, and confirm the error rate drops. Then investigate with logs and traces filtered to the affected requests, find the pattern (region, client version, feature flag), fix it, and add a test or canary check that would have caught it.

Culture and practices

30What does DevOps mean to you?

Mid

A culture where the teams that build software also share responsibility for running it, supported by automation, fast feedback and measurement. Tools matter less than shortening the path from code to production safely, and learning from failures.

31What are the DORA metrics?

Mid

Four delivery performance metrics: deployment frequency, lead time for changes, change failure rate, and time to restore service. They balance speed and stability and are a common way to measure DevOps improvements.

How to prepare

  1. Practice troubleshooting out loudSlow site, full disk, failing pods, broken DNS: scope, hypothesize, check, mitigate.
  2. Know one cloud deeplyNetworking, IAM, compute, managed databases and costs on AWS, GCP or Azure.
  3. Bring real pipeline and IaC examplesWhat you built, why, and what broke.
  4. Prepare an incident storyYour role, the mitigation, the root cause and the follow-ups.
  5. Refresh Linux and networking basicsThey underpin most scenario questions.

Get answer points in real time during your interview

Sottena listens to the interviewer, detects each question and shows short answer points in about a second. 150 free credits, no card required.

Related interview questions