DevOps interview questions
39 questions, easy to hard. Read one, then answer it out loud: an AI interviewer follows up, hints when you're stuck and grades your answer.
DevOps interviews cover shipping and running software: Git, CI/CD, containers, Kubernetes, infrastructure as code, monitoring and incidents.
Git
A new developer has only ever saved files and is nervous about Git. Explain what a commit is, what a branch really is, and what happens when you create a branch and commit on it.
- Write a Good Commit Message
- easy
- Pro
Your team's history is full of commit messages like fix and stuff. Explain what makes a good commit message and a good-sized commit, and why it matters months later.
- Resolve a Merge Conflict
- easy
- Pro
You try to merge the main branch into your feature branch and Git reports a conflict in a file you both changed. Explain why the conflict happened and walk through resolving it safely.
- Merge or Rebase?
- medium
- Pro
Two teammates argue about whether to merge or rebase to bring a feature branch up to date with main. Explain what each does to the history, the trade-offs, and the one rule that keeps rebasing safe.
- Undo a Mistake
- medium
- Pro
A colleague committed a bug that's already been pushed to main, and separately you made a bad commit locally that nobody has seen. Explain how you'd undo each one, and the difference between revert and reset.
- Choose a Branching Strategy
- medium
- Pro
Your team uses long-lived feature branches that take weeks to merge and end in painful conflicts. Compare trunk-based development with a Git Flow style of branching, and recommend one for a team deploying a web app several times a day.
- Find a Bug with Bisect
- hard
- Pro
A feature that worked in last month's release is broken now, and there are four hundred commits in between. Explain how you'd use Git bisect to find the commit that broke it, and how to make the search fast and reliable.
CI/CD
Your manager uses continuous integration, continuous delivery and continuous deployment as if they mean the same thing. Explain the difference between the three, and what each one requires of the team.
- Speed Up a Slow Pipeline
- easy
- Pro
Your CI pipeline takes forty minutes, so developers batch up changes and stop waiting for it. Explain how you'd find where the time goes and the techniques you'd use to bring it under ten minutes.
- Build Once, Deploy Many
- medium
- Pro
Your pipeline rebuilds the app separately for staging and for production, and once a bug appeared only in production. Explain the build once, deploy many principle and how you'd change the pipeline to follow it.
- Secrets in a Pipeline
- medium
- Pro
Your deploy job needs cloud credentials, and right now they're pasted into the pipeline file in the repository. Explain why that's dangerous and how you'd give the pipeline the access it needs safely.
- Roll Back a Bad Deploy
- medium
- Pro
Ten minutes after a deploy, error rates jump and customers are complaining. Explain how you'd decide between rolling back and fixing forward, and what has to be true of your pipeline for a rollback to be quick and safe.
- Migrations in the Pipeline
- hard
- Pro
You want database migrations to run automatically as part of every deploy. Explain where in the pipeline they should run, what can go wrong, and how you'd keep deploys safe when a migration and new code ship together.
Containers
A teammate keeps mixing up Docker images and containers. Explain the difference, what happens when you run an image, and what happens to files written inside a container when it's removed.
- Write a Dockerfile
- easy
- Pro
You need to containerise a small Node.js web server for the first time. Talk through the Dockerfile you'd write, step by step, and why each step is there.
- Layer Caching
- medium
- Pro
Every time you change one line of code, your Docker build reinstalls all dependencies and takes five minutes. Explain how image layers and the build cache work, and how you'd reorder the Dockerfile to fix this.
- Shrink an Image
- medium
- Pro
Your production image is one and a half gigabytes because it contains compilers, test tools and the whole source tree. Explain why size matters and how you'd use a multi-stage build and other techniques to make it small.
- Volumes and Persistent Data
- medium
- Pro
You run Postgres in a container for local development, and every time you recreate the container your data disappears. Explain why, and compare named volumes and bind mounts as fixes.
- Local Development with Compose
- medium
- Pro
Your app needs a web server, a Postgres database and Redis, and new joiners spend a day setting them up. Explain how you'd use Docker Compose to start everything with one command, including how the services find each other.
- Harden a Container
- hard
- Pro
A security review flags that your containers run as root, use an unpinned latest base image and have never been scanned. Explain why each is a risk and how you'd harden the image and its runtime settings.
Kubernetes
You're deploying a web app to Kubernetes for the first time. Explain what a pod, a deployment and a service are, and how they work together to keep your app running and reachable.
- Readiness and Liveness Probes
- medium
- Pro
Your pods receive traffic before they've finished warming up, and one pod got stuck but was never restarted. Explain readiness and liveness probes and how you'd configure them for this app.
- Requests and Limits
- medium
- Pro
Some of your pods are being killed with out-of-memory errors, while others are slow because of CPU throttling. Explain resource requests and limits for CPU and memory, and how you'd choose the values.
- Rolling Updates
- medium
- Pro
You push a new version of your deployment and want zero downtime. Explain how a Kubernetes rolling update works, which settings control its pace, and what makes it safe or unsafe.
- ConfigMaps and Secrets
- medium
- Pro
Your container image has database settings and an API key baked into it. Explain how you'd move configuration into ConfigMaps and Secrets, and what Kubernetes Secrets do and don't protect.
- Autoscale a Deployment
- hard
- Pro
Traffic to your service triples every evening and you're paying for idle pods all day. Explain how you'd autoscale with the Horizontal Pod Autoscaler and the cluster autoscaler, and the pitfalls to watch for.
Infrastructure as Code
- Declarative or Imperative?
- easy
- Pro
One engineer manages servers with a shell script of commands, another with a Terraform file describing what should exist. Explain the difference between imperative and declarative infrastructure, and why running each a second time behaves differently.
- Plan and Apply
- easy
- Pro
A colleague wants to change a database's instance size by editing the Terraform file and applying it straight away. Explain the plan and apply workflow, and what you'd look for in the plan before approving.
- Manage the State File
- medium
- Pro
Your team keeps the Terraform state file on one engineer's laptop, and two people applying at once has corrupted it. Explain what the state file is for and how you'd store and protect it properly.
- Handle Drift
- medium
- Pro
During an incident someone changed a firewall rule by hand in the cloud console, and now the next plan wants to undo it. Explain what drift is, how to detect it, and how you'd resolve this case.
- Write a Reusable Module
- medium
- Pro
Five teams each copied and slightly changed the same Terraform code for a web service with a load balancer, and they've drifted apart. Explain how you'd design a reusable module, and how you'd version and roll out changes to it.
- Split Environments Safely
- hard
- Pro
All your infrastructure, staging and production together, lives in one huge Terraform configuration, so every plan takes ten minutes and a staging change once touched production. Explain how you'd restructure it.
Monitoring and Incidents
You've been asked to set up monitoring for a web service that currently has none. Explain the four golden signals, what each tells you, and which you'd look at first during an outage.
- Alert on Symptoms
- easy
- Pro
Your on-call engineer gets paged forty times a week, mostly for high CPU that never affects users, and has started ignoring alerts. Explain how you'd redesign alerting so every page matters.
- Write a Runbook
- easy
- Pro
An alert fires at three in the morning for a queue backing up, and the engineer on call has never seen this system. Explain what a good runbook for that alert contains and how you'd keep it useful.
- Run an Incident
- medium
- Pro
Checkout is failing for all customers, and ten engineers have piled into a chat channel all trying things at once. Explain how you'd run this incident, including the roles you'd assign and how you'd communicate.
- Blameless Postmortem
- medium
- Pro
After an outage caused by an engineer running a command against the wrong database, a manager wants to know who's to blame. Explain what a blameless postmortem is, what it should contain, and why blame makes systems less safe.
- Healthy On-Call
- medium
- Pro
Your team's on-call rotation is burning people out and two engineers have threatened to quit. Explain how you'd design a sustainable on-call rotation and measure whether it's improving.
- Debug a Latency Spike
- hard
- Pro
Your API's slowest one percent of requests jumped from two hundred milliseconds to three seconds an hour ago, while the average barely moved. Walk through how you'd investigate using metrics, logs and traces.
Questions about practising
- How should I prepare for devops interview questions?
- Practise answering them out loud, not just reading them. Explaining an answer under follow-up questions is what interviews test. Work through the 39 questions here from easy to hard, and revisit the ones you struggle with.
- Can I practise devops interview questions with an AI?
- Yes. Open any question and start a voice session: an AI interviewer asks it, follows up on your answer, gives hints when you're stuck and grades your answer with written feedback when the call ends.
- Are these devops interview questions free?
- 5 of the 39 questions are free to practise. Sign in with Google, no card needed. Pro unlocks the rest, plus practice calls to your phone.