Introduction
DevOps interviews are broad by design: one interview can move from Linux to Docker to Kubernetes to CI/CD to cloud to a troubleshooting scenario, because the job itself spans all of them. Interviewers are not testing whether you have memorised definitions. They are testing whether you have actually run systems — whether you understand the trade-offs, what you do when something breaks, and whether you can explain your decisions clearly.
This article gives 20 questions in the form interviewers ask them, grouped from easy to advanced, with model answers that show reasoning. Each answer is written so you can adapt it to your own experience. If you have never used a concept in production, say so and explain how you would approach it; interviewers respect honesty far more than a rehearsed definition that falls apart on the first follow-up. For tool-specific depth, see our companion articles: Terraform Interview Questions and Answers for infrastructure as code, and our Kubernetes Tutorial for Beginners for the concepts behind the Kubernetes questions here.
Version note (26 Nov 2026): tool versions move quickly — Docker Engine is at 29.10.1 and Kubernetes at 1.37. Check the version numbers on the day of your interview, and never present a version from memory as current without qualifying it.
How to Use This Article
Read the easy questions first and answer them aloud before reading the model answer. For each one, ask yourself the follow-up an interviewer would ask: “What happens when that goes wrong?” That second question is where interviews are won. The advanced section is where senior candidates separate themselves — if you are applying for a junior role, understanding the concepts is enough; you are not expected to have solved all of them in production.
Easy — Core Concepts
1. What is DevOps, and what problem does it solve?
DevOps is the practice of combining development and operations so that software can be built, tested, released and operated reliably and quickly, by the same teams that build it. It solves the problem of handoffs: developers throwing code over a wall to operations, releases that take weeks, and incidents nobody owns. In practice it means shared ownership, automation (especially CI/CD and infrastructure as code), small frequent releases, and feedback from production back into development. It is a way of working supported by tools — not a tool, and not a job title that means one thing everywhere.
Follow-up: “DevOps vs SRE vs platform engineering?” — SRE (site reliability engineering) is a specific implementation of DevOps ideas with error budgets and a strong reliability focus; platform engineering builds the internal tools and paved roads that product teams use to do DevOps themselves. All three overlap heavily in practice.
2. What is CI/CD, and what is the difference between continuous integration, continuous delivery and continuous deployment?
CI/CD is the automated path from a code commit to a running system. Continuous integration means developers merge code into a shared branch frequently, and every merge triggers an automated build and test run, so integration problems surface in hours, not weeks. Continuous delivery extends that: every change that passes the tests is deployable at any time, but a human still decides when to release. Continuous deployment goes one step further: every passing change is deployed to production automatically, with no human gate. The difference between delivery and deployment is who — or what — presses the button. Our GitHub Actions Tutorial builds a real CI pipeline with a deployment job gated by an environment approval, which is continuous delivery in practice.
3. What is the difference between a Docker image and a container?
An image is a read-only template — a layered snapshot containing the application, its runtime and its dependencies. A container is a running instance of an image: a lightweight, isolated process on the host kernel. You can run many containers from one image, and deleting a container does not delete its image. Containers share the host kernel, which is why they start in under a second and use far less memory than virtual machines — a virtual machine carries a whole guest operating system. See our Docker Tutorial for Beginners for the full picture, including multi-stage Dockerfiles.
4. What is Kubernetes, and why would you use it instead of running Docker directly?
Kubernetes orchestrates containers across many machines: it keeps a desired number of copies running, restarts failed ones, routes traffic with Services, rolls out new versions gradually and rolls back if they fail. Running Docker directly is simpler and cheaper for one application on one server; Kubernetes earns its complexity when you have many services, need high availability, or deploy frequently. The core idea is desired state: you describe what should be running, and the control plane continuously works to make reality match it.
5. What is infrastructure as code, and why does it matter?
Infrastructure as code means defining servers, networks, databases and other infrastructure in versioned configuration files — Terraform is the standard tool — instead of creating them by clicking in a console. It matters because the infrastructure becomes reviewable in a pull request, reproducible in another environment, and auditable: you can see who changed what, when, and roll it back. The single most important concept is state: Terraform maps each resource in your code to a real cloud object, and in a team that state must live in a shared, locked, encrypted remote backend.
Medium — Docker, Kubernetes and CI/CD
6. How do you keep data safe when a container is deleted?
You do not store data in a container’s filesystem — it is ephemeral by design. Use a named volume for data that must survive, such as a database’s data directory, or external storage (a managed database, object storage) for anything important. In Kubernetes the equivalent is a PersistentVolumeClaim. The rule is the same in both: containers are cattle, not pets — delete them freely, and keep state somewhere designed to last.
7. A Pod is in CrashLoopBackOff. How do you debug it?
Start with kubectl describe pod <name> for the events, which usually name the cause — a missing image, a failed health check, a resource limit — then kubectl logs <pod> --previous to read the logs of the last crashed instance (the current Pod may have no logs yet). Common causes: the application exits on start (bad configuration, missing environment variable, database unreachable), the liveness probe is too aggressive, or the container is being killed for exceeding its memory limit. Fix the cause in the image or the manifest, not by restarting the Pod by hand — it will crash again. And check the difference between readiness and liveness probes: a failing readiness probe removes the Pod from the Service, a failing liveness probe restarts it.
8. How does a rolling update work, and how do you roll back?
A Deployment replaces Pods gradually — by default it takes down no more than 25% of the old version at a time and brings up new Pods alongside them — so the application stays available during the update. Kubernetes waits for new Pods to pass their readiness probes before continuing. If the new version is broken, kubectl rollout undo deployment/<name> returns to the previous ReplicaSet, and kubectl rollout status shows progress. The key enabler is readiness probes: without them, Kubernetes cannot tell a healthy new Pod from one that is still starting, and traffic can reach a Pod that is not ready.
9. What is the difference between a ConfigMap and a Secret in Kubernetes?
Both inject configuration into a Pod, outside the image, so the same image can run in different environments. A ConfigMap holds non-sensitive configuration (feature flags, URLs, file contents); a Secret holds sensitive data (passwords, tokens, certificates). The important caveat is that a Secret is base64-encoded, not encrypted, by default — treat Secrets as sensitive, restrict who can read them with RBAC, and use a proper secrets manager in production.
10. How would you design a CI/CD pipeline for a small web application?
Push triggers a workflow that checks out the code, installs dependencies, runs tests and linting, builds a Docker image, scans it for vulnerabilities, pushes it to a registry tagged with the commit SHA, and then deploys it to staging automatically and to production behind a manual approval. Add a concurrency group so two pushes do not deploy over each other, cache dependencies between runs, and keep the pipeline definition in the repository so it is reviewed like code. The concrete version of this, with full YAML, is our GitHub Actions Tutorial.
11. What is the difference between GitHub Actions and Jenkins?
Both run pipelines defined as code, with stages, triggers and agents. GitHub Actions needs no server to maintain — runners are provided by GitHub, configuration lives in the repository, and it is free for public repositories. Jenkins needs a controller and agents that you patch, back up and secure, but it runs anywhere, including fully on-premises networks, and has an enormous plugin ecosystem. Learn GitHub Actions first in 2026; learn Jenkins’ concepts afterwards, because many larger organisations still run it.
12. How do you handle secrets in a pipeline?
Store them in the platform’s secrets store (GitHub Secrets, your cloud provider’s secrets manager), inject them as environment variables at run time, and never print them — CI systems mask known secrets in logs, but a transformed secret can slip through. Prefer short-lived credentials issued via OIDC over long-lived keys stored anywhere, rotate any secret that has ever appeared in a log or in Git history, and never bake a secret into a Docker image layer, where it survives even if a later layer deletes it.
Advanced — Cloud, Reliability and Troubleshooting
13. A production service is down. Walk me through your response.
First, confirm the symptom and its scope: is it one service, one region, or everything? Check the status page or monitoring, then look at the most recent change — deployments, configuration changes and infrastructure changes are the most common cause of a fresh outage. If a recent deployment is suspect, roll it back; restoring service matters more than finding the root cause in the moment. Then dig: logs, metrics, and the difference between what changed and what did not. Communicate early and regularly to stakeholders, with what you know and what you are doing — silence is worse than bad news. After the incident, write a blameless post-mortem: what happened, why, what you changed, and what would have caught it earlier. Interviewers listen for calm, order and communication, not heroics.
14. How do you design for high availability on AWS?
Spread across multiple Availability Zones, never one: multi-AZ databases, load balancers across AZs, and stateless application servers that can be replaced. Use managed services where they fit (RDS Multi-AZ, S3, managed load balancing), health checks that remove unhealthy instances, auto-scaling for load, and backups with a tested restore — a backup you have never restored is a hope, not a plan. And design for failure modes explicitly: what happens when an AZ fails, when a dependency is slow, when a deployment is bad? The answers are timeouts, retries with backoff, circuit breakers and graceful degradation, not optimism. For the certification path behind this, follow the AWS Certification Roadmap 2026.
15. What is the difference between horizontal and vertical scaling, and when would you choose each?
Vertical scaling means a bigger machine — more CPU or memory for the same instance. It is simple and it works until you hit the largest machine available, and it usually requires downtime to resize. Horizontal scaling means more machines, behind a load balancer, and it is the standard approach for stateless services because it scales further and survives a single machine failing. Choose vertical scaling for stateful systems that are hard to split (a single database), horizontal for stateless services, and remember that horizontal scaling only works if the application is designed for it: no local state, sessions in a shared store, and idempotent operations.
16. How do you monitor a system, and what do you alert on?
Monitor the four golden signals — latency, traffic, errors and saturation — plus business metrics that matter to users, such as successful checkouts or sign-ups. Alert only on symptoms a human must act on, with a clear runbook attached: an alert that fires and needs no action teaches the team to ignore alerts. Use SLOs and error budgets to decide how much reliability is enough — 100% uptime is not a goal, it is a refusal to choose. And instrument before you need it: adding logging and metrics during an incident is too late.
17. What is the difference between blue-green and canary deployments?
In a blue-green deployment you run the new version (green) alongside the old (blue), test it, then switch all traffic at once — and switch back instantly if something is wrong. In a canary deployment you shift a small percentage of traffic to the new version, watch its error rate and latency, and increase the percentage gradually. Blue-green is simpler and gives instant rollback; canary catches problems that only appear under real traffic, at the cost of running two versions and comparing them carefully. Feature flags are a third option, letting you deploy code that is switched on for a subset of users without a redeploy.
18. How do you manage Terraform state in a team?
State lives in a shared, encrypted, versioned remote backend — an S3 bucket with versioning and encryption on AWS — with locking so two applies cannot write at the same time (native lockfile, use_lockfile = true, on modern Terraform). Access to state is effectively access to the infrastructure, so restrict it tightly with IAM, never commit state to Git, mark sensitive values as sensitive, and rotate any secret that has ever appeared in an exposed state file. For the full treatment, including workspaces, modules and drift, see our Terraform Interview Questions and Answers.
19. What is GitOps, in one minute?
GitOps is the practice of managing infrastructure and applications declaratively in Git, with an automated agent that continuously reconciles the cluster with what Git says. A change is a pull request; merging it triggers the agent to apply it; the cluster’s state is always visible in the repository, and drift is detected and corrected automatically. Tools such as Argo CD and Flux implement it for Kubernetes. Its advantages are auditability and a single source of truth; its cost is the discipline of putting everything in Git, including secrets handling, which needs a proper solution (sealed secrets or an external secrets operator) rather than plaintext in a repository.
20. Tell me about a time you improved a deployment process.
This is a behavioural question, and the structure matters more than the story. Use the STAR format: the situation (deployments took two hours and failed half the time), the task (make them reliable), the action (what you actually did — automated the build, added tests, introduced a staging environment, wrote the runbook), and the result (quantified: deployment time from two hours to ten minutes, failure rate from 50% to near zero, and what the team could do with the time saved). Pick a real example, own your part honestly, and mention what you would do differently next time — interviewers trust candidates who can critique their own work.
Frequently Asked Questions
How should I prepare for a DevOps interview? Practise the fundamentals in this article out loud, then build the things they describe: a Docker image, a Kubernetes deployment, a CI pipeline, a Terraform project. Interviewers can tell within minutes whether you have run these tools or only read about them.
Do I need to know Kubernetes for a junior DevOps role? For most mid-level roles, yes. For some junior or AWS-focused roles, Docker and cloud skills may be enough to start, but Kubernetes should be on your plan within the first year — see our DevOps Engineer Roadmap 2026 for the order.
What is the most common DevOps interview mistake? Reciting definitions without examples. Every answer should include a concrete detail from something you built or fixed — a command, a failure, a trade-off you made — even if it was in a home lab.
How long should my answers be? About a minute for a factual question, two to three for a scenario. If you are talking for five minutes, you have lost the interviewer; stop, summarise, and ask whether they want more detail.
What questions should I ask the interviewer? Ask about the on-call rota, how deployments work, what the biggest reliability problem is right now, and how the team measures success. The answers tell you more about the job than the job description does — and they show you are thinking like an engineer, not an applicant.
Conclusion
DevOps interviews reward the same thing the job rewards: breadth with depth in at least one area, calm troubleshooting, and honest answers grounded in things you have actually built. Work through these 20 questions aloud, build the examples in our Docker, Kubernetes, GitHub Actions and Terraform articles, and go into the interview able to say “here is what I built, here is what broke, and here is what I changed”. That is what gets you hired.
Next step: pick the three questions above you could not answer confidently, and spend this week building the thing each one describes. Also check the DevOps Engineer Salary in the USA, UK, Canada and Australia before you negotiate an offer.
