Skip to content
Resume Studioby M2Toolkit

10 role-specific questions

DevOps Engineer Interview Questions & Answers

DevOps and platform interviews cover delivery pipelines, containers and Kubernetes, infrastructure as code, observability, secrets and how you handle incidents.

Free, no sign-up. 83 questions in this role's practice pool, including behavioural, HR and situational questions.

DevOps & cloud interview questions

CI/CD, containers, Kubernetes, infrastructure as code, monitoring and incident response.

  1. 1.

    Describe a good CI/CD pipeline for a web application.

    BeginnerTechnical

    What the interviewer is evaluating

    Delivery fundamentals.

    Key points a strong answer covers

    • CI on every change. Every change triggers build and tests automatically.
    • Stages. Lint, test, security scan, build an artifact once.
    • Environments & promotion. Deploy the same artifact to staging, then production.
    • Safe deployment. Rolling/canary/blue-green deployments with quick rollback.
    • Fast feedback. Keep it fast with caching and parallel jobs.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Building separately for each environment.
    • No rollback plan.

    Likely follow-up questions

    • How would you speed up a 40-minute pipeline?
    • What's the difference between continuous delivery and continuous deployment?
    Example strong answer

    Every pull request triggers CI: install dependencies with caching, lint and type-check, run unit and integration tests, run security checks like dependency and secret scanning, then build an artifact — usually a container image — exactly once, tagged with the commit. Merging to main deploys that same artifact to staging, where smoke and end-to-end tests run, and then promotes it to production, either automatically or with an approval. Production deploys are gradual — rolling or canary — with health checks and automatic rollback if error rates rise, and feature flags decouple releasing a feature from deploying code. I keep the pipeline fast, ideally under ten minutes, with caching and parallel jobs.

    Practise this question and get feedback
  2. 2.

    What is a container, and how is it different from a virtual machine?

    BeginnerTechnical

    What the interviewer is evaluating

    Containerisation basics.

    Key points a strong answer covers

    • Shares the host kernel. Containers share the host OS kernel and isolate processes.
    • VM has full OS. A VM runs a full guest OS on a hypervisor.
    • Isolation mechanisms. Namespaces and cgroups isolate and limit containers.
    • Image & portability. Images package the app and dependencies for consistent environments.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Saying containers are mini VMs.
    • Ignoring that weaker isolation has security implications.

    Likely follow-up questions

    • How would you make a Docker image smaller?
    • Why shouldn't containers run as root?
    Example strong answer

    A container is an isolated process — or group of processes — that shares the host's operating system kernel. Linux namespaces give it its own view of the filesystem, network and processes, and cgroups limit its CPU and memory. A virtual machine instead runs a complete guest operating system on a hypervisor. So containers start in seconds and are lightweight, while VMs give stronger isolation. The image packages the app with its exact dependencies in layers, so it runs the same on a laptop, in CI and in production. I keep images small with multi-stage builds and slim base images, and run as a non-root user.

    Practise this question and get feedback
  3. 3.

    What makes a good, production-ready Dockerfile?

    IntermediateTechnical

    What the interviewer is evaluating

    Practical container hygiene.

    Key points a strong answer covers

    • Small base / multi-stage. Multi-stage builds and slim or distroless base images.
    • Layer caching. Copy dependency manifests first so the install layer is cached.
    • Non-root & security. Run as non-root, pin versions, scan images, no secrets in layers.
    • Runtime concerns. Handle SIGTERM, add a .dockerignore, configure via env.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Copying the whole repo before installing dependencies.
    • Baking secrets into the image.

    Likely follow-up questions

    • Why does instruction order affect build speed?
    • How does a process handle SIGTERM in a container?
    Example strong answer

    I use a multi-stage build: one stage with the full toolchain compiles the app, and the final stage copies only the output onto a slim or distroless base, so the image is small and has less attack surface. I order instructions for caching: copy the dependency manifest, install, then copy the source, so code changes don't reinstall everything. A .dockerignore keeps node_modules, .git and local env files out. The final image runs as a non-root user, pins base image versions, gets scanned for vulnerabilities in CI, and never contains secrets — they come from the environment at runtime. The app handles SIGTERM to shut down gracefully, and configuration comes from environment variables.

    Practise this question and get feedback
  4. 4.

    Explain the main Kubernetes objects and what each is for.

    IntermediateTechnical

    What the interviewer is evaluating

    Working knowledge of Kubernetes.

    Key points a strong answer covers

    • Pod. A Pod is one or more containers scheduled together — the smallest unit.
    • Deployment / ReplicaSet. A Deployment manages replicas and rolling updates.
    • Service / Ingress. A Service gives pods a stable address; Ingress/Gateway routes external HTTP.
    • Config & secrets. ConfigMaps and Secrets inject configuration.
    • Health & scaling. Probes, resource requests/limits and the HorizontalPodAutoscaler.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Running bare pods without a controller.
    • No readiness probes, so traffic hits pods that aren't ready.

    Likely follow-up questions

    • What's the difference between liveness and readiness probes?
    • Why set resource requests and limits?
    Example strong answer

    A Pod is the smallest unit: one or more containers that share networking and storage, scheduled together on a node. You rarely create pods directly; a Deployment declares how many replicas you want and manages rolling updates and rollbacks through ReplicaSets. Because pods come and go, a Service gives them a stable name and load-balances between them, and an Ingress or the Gateway API routes external HTTP traffic to Services. ConfigMaps and Secrets inject configuration. Readiness probes stop traffic until a pod is ready, liveness probes restart stuck containers, resource requests and limits help the scheduler and protect neighbours, and a HorizontalPodAutoscaler scales replicas on metrics like CPU.

    Practise this question and get feedback
  5. 5.

    What is infrastructure as code, and how do you use it safely?

    IntermediateTechnical

    What the interviewer is evaluating

    Reproducible, reviewable infrastructure.

    Key points a strong answer covers

    • Definition. Infrastructure defined in version-controlled code.
    • Tools. Terraform/OpenTofu, Pulumi, CloudFormation, Bicep.
    • Plan & review. Review a plan in a pull request before applying.
    • State management. Remote, locked state files.
    • Modules & drift. Reusable modules per environment; detect drift.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Making manual console changes that drift from the code.
    • Storing state locally or committing it.

    Likely follow-up questions

    • What happens if two people run terraform apply at once?
    • How do you handle secrets in IaC?
    Example strong answer

    Infrastructure as code means defining servers, networks, databases and permissions in code — Terraform or OpenTofu, Pulumi, CloudFormation — stored in Git, so infrastructure is reproducible, reviewed and has history. Changes go through a pull request where CI runs terraform plan and posts the diff, and someone reviews exactly what will change before it's applied, ideally by the pipeline rather than a laptop. State is stored remotely with locking so two applies can't collide, and it's never committed since it can contain secrets. Reusable modules keep staging and production consistent, secrets come from a secrets manager, and I detect drift from manual console changes regularly.

    Practise this question and get feedback
  6. 6.

    Production is down. Walk me through how you respond.

    IntermediateTechnical

    What the interviewer is evaluating

    Calm, structured incident handling.

    Key points a strong answer covers

    • Assess & declare. Confirm the impact and declare an incident with a severity.
    • Roles & communication. Assign roles, communicate on a channel and status page.
    • Mitigate first. Restore service first — roll back recent changes — before root-causing.
    • Use data. Use dashboards, logs and recent changes to find the cause.
    • Post-mortem. A blameless post-mortem with action items.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Debugging the root cause while users are down instead of rolling back.
    • No communication with stakeholders.

    Likely follow-up questions

    • What goes in a good post-mortem?
    • How do you decide between rollback and a fix forward?
    Example strong answer

    First I confirm the impact — which users, which features, since when — and declare an incident with a severity so the right people join. Someone takes the incident commander role, someone handles communication: a dedicated channel, regular updates to stakeholders and the status page. The priority is restoring service, not finding the root cause: I check what changed recently — deploys, config, feature flags, infrastructure — and roll back or disable the change if it lines up, using dashboards, logs and traces to confirm. Once service is stable, we investigate properly. Afterwards there's a blameless post-mortem with a timeline, the root cause and contributing factors, and owned action items.

    Practise this question and get feedback
  7. 7.

    What would you monitor for a web service, and how would you set up alerts?

    IntermediateTechnical

    What the interviewer is evaluating

    Signal over noise in monitoring.

    Key points a strong answer covers

    • Golden signals. Latency, traffic, errors, saturation.
    • SLOs. SLOs and error budgets define what 'good' means.
    • Alert on symptoms. Page on user-facing symptoms; avoid noisy alerts.
    • Tools / logs / traces. Metrics, logs and traces in tools like Prometheus/Grafana or Datadog.
    • Runbooks. Every alert links to a runbook.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Alerting on every CPU spike.
    • No SLOs, so nobody knows if the service is healthy.

    Likely follow-up questions

    • What's an error budget and how does it guide decisions?
    • How do you reduce alert fatigue?
    Example strong answer

    I'd monitor the golden signals: latency (p50, p95, p99), traffic, error rate and saturation — CPU, memory, connection pools, queue depth — plus business signals like checkouts per minute. I define SLOs with the team, such as 99.9% of requests succeeding and 95% completing under 300 ms over 30 days, which gives an error budget. Pages go out only for user-facing symptoms that need action now, like burning the error budget too fast; causes such as high CPU go to dashboards or low-urgency tickets. Every alert links to a runbook. Metrics live in something like Prometheus and Grafana or Datadog, alongside structured logs and traces.

    Practise this question and get feedback
  8. 8.

    How do you manage secrets in pipelines and production?

    IntermediateTechnical

    What the interviewer is evaluating

    Security in operations.

    Key points a strong answer covers

    • Never in code. Secrets are never committed or hard-coded.
    • Secret managers. Use a secrets manager (Vault, AWS Secrets Manager, Azure Key Vault).
    • Least privilege / short-lived. Prefer short-lived credentials (OIDC, workload identity) and least privilege.
    • Rotation & detection. Rotate regularly, scan for leaks, audit access.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Long-lived cloud keys stored in CI variables.
    • Printing secrets in logs.

    Likely follow-up questions

    • How does OIDC let CI deploy without stored cloud keys?
    • What do you do when a secret is committed to Git?
    Example strong answer

    Secrets never go in the repository — I run secret scanning like gitleaks in CI and pre-commit hooks to catch mistakes. In production they live in a secrets manager — Vault, AWS Secrets Manager or Azure Key Vault — and are injected at runtime, with access granted per service on least privilege. Wherever possible I avoid long-lived credentials altogether: CI deploys to the cloud using OIDC federation and short-lived tokens, and workloads use cloud identities instead of keys. Secrets are rotated regularly and access is audited. If one is ever committed, I treat it as compromised: revoke and rotate it first, then clean up history.

    Practise this question and get feedback
  9. 9.

    How would you design cloud infrastructure for high availability?

    AdvancedTechnical

    What the interviewer is evaluating

    Reliability architecture.

    Key points a strong answer covers

    • Redundancy across zones. Run across multiple availability zones with no single point of failure.
    • Load balancing & autoscaling. Load balancers with health checks and autoscaling.
    • Data layer. Replicated managed databases with automatic failover and tested backups.
    • Stateless apps. Stateless app tiers so instances are replaceable.
    • RTO / RPO & testing. Define RTO/RPO and test failover regularly.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Never testing backup restores.
    • A single database instance in one zone.

    Likely follow-up questions

    • What are RTO and RPO?
    • When is multi-region worth the cost?
    Example strong answer

    I start with requirements: the target availability and the RTO and RPO — how long we can be down and how much data we can lose. Then I remove single points of failure: stateless application instances spread across at least two or three availability zones behind a load balancer with health checks and autoscaling; sessions and files in shared services like Redis and object storage. The database is a managed service with a synchronous standby in another zone and automatic failover, plus point-in-time backups that we actually test restoring. Multi-region is for when a whole-region outage is unacceptable, and it adds a lot of cost and complexity. Finally, I test failover with game days, because untested redundancy often doesn't work.

    Practise this question and get feedback
  10. 10.

    A Linux server is slow. What commands and steps would you use to investigate?

    IntermediateTechnical

    What the interviewer is evaluating

    Hands-on troubleshooting.

    Key points a strong answer covers

    • CPU / load. top/htop and load average for CPU.
    • Memory. free, vmstat and dmesg for memory pressure, swapping and OOM kills.
    • Disk. df/du for space, iostat for I/O wait.
    • Network. ss/netstat for connections, ping/curl/dig for network issues.
    • Logs. journalctl and application logs.

    Suggested answer structure

    1. Define it in one sentence.
    2. Explain how it works underneath.
    3. Give a practical example from code or a project.
    4. Close with a trade-off, pitfall or when you'd use it.

    Common mistakes

    • Restarting the server before collecting evidence.
    • Checking only CPU.

    Likely follow-up questions

    • What does a high load average with low CPU usage suggest?
    • How would you find which process is filling the disk?
    Example strong answer

    I'd follow a quick checklist before restarting anything. uptime and top or htop show load average and which processes use CPU — a high load with idle CPU often points to I/O wait. free -h and vmstat 1 show memory pressure and swapping, and dmesg or journalctl -k reveal whether the OOM killer has been killing processes. df -h and df -i check disk space and inodes, du finds what's filling it, and iostat -x shows whether the disk is saturated. ss -tunap shows connections — thousands in TIME_WAIT or a full connection pool. Then the service's logs with journalctl -u. Once I find the cause, I fix it and add monitoring so it's caught earlier next time.

    Practise this question and get feedback

Behavioural & HR questions you'll also get

These come up in almost every devops engineer interview. Story questions are best answered with STAR — Situation, Task, Action, Result.

  • Tell me about yourself.

    BeginnerHR

    What the interviewer is evaluating

    Whether you can give a concise, relevant pitch that frames your experience around this job.

    Key points a strong answer covers

    • Present. Start with your current role and what you do.
    • Relevant past. Pick the most relevant past experience.
    • Strength / achievement. Include one strength or achievement with evidence.
    • Why this role. Finish with why this role is the next step.

    Suggested answer structure

    1. Present — your current role in one or two sentences.
    2. Past — the experience most relevant to this job.
    3. Proof — one achievement or strength with evidence.
    4. Future — why this role is the logical next step.

    Common mistakes

    • Reciting your whole CV chronologically.
    • Personal life story unrelated to the job.
    • Going over two minutes.

    Likely follow-up questions

    • Why are you looking to leave your current role?
    • What would your manager say is your biggest strength?
    Example strong answer

    I'm a front-end developer with four years' experience, currently at a fintech start-up where I build the customer dashboard in React and TypeScript. Before that I spent two years at an agency building e-commerce sites, which taught me to work fast with lots of different clients. The thing I'm proudest of recently is leading our move to a shared component library, which cut the time to build new screens by about a third. I'm now looking for a role where I can work on a larger product with a strong design system, which is exactly what drew me to this position.

  • Why should we hire you?

    BeginnerHR

    What the interviewer is evaluating

    Whether you understand the role and can match your strengths to its needs with evidence.

    Key points a strong answer covers

    • Role's needs. Show you understand what the role needs.
    • Matching strengths. Match two or three strengths to those needs.
    • Evidence. Back each with evidence.
    • Enthusiasm. Close with genuine enthusiasm.

    Suggested answer structure

    1. Name the two or three things the role needs most.
    2. Match each with your experience and evidence.
    3. Add what makes you different.
    4. Finish with genuine interest.

    Common mistakes

    • Generic claims like 'I'm hardworking' with no evidence.
    • Comparing yourself to other candidates you don't know.

    Likely follow-up questions

    • What would you do in your first 90 days?
    • What's one area where you'd need support?
    Example strong answer

    From the job description and our conversation, you need someone who can take ownership of the customer onboarding process, work with sales and product, and improve the numbers. I've done exactly that for three years: at my current company I redesigned onboarding for new accounts and cut the time to first value from 14 days to 6. I'm comfortable working across teams — I run a weekly session with sales and product on customer feedback — and I'm very data-driven, so I'd measure everything from day one. I'm also genuinely excited about your product, because it solves a problem I've seen customers struggle with.

  • Tell me about a time you disagreed with a teammate. How did you handle it?

    BeginnerBehavioural

    What the interviewer is evaluating

    Handling conflict constructively and keeping relationships.

    Key points a strong answer covers

    • Listened to their view. Show you listened to understand their view.
    • Used facts / common goal. Bring it back to facts or a shared goal.
    • Resolution & relationship. Resolve it and keep the relationship.

    Suggested answer structure

    1. Situation — one or two sentences of context.
    2. Task — what you were responsible for.
    3. Action — what you did, step by step (say “I”).
    4. Result — what changed, with a number if you can back it up.
    5. Reflection — what you learned or would do differently.

    Common mistakes

    • Making the other person the villain.
    • A story where you were simply right and they gave in.

    Likely follow-up questions

    • What if you couldn't reach agreement?
    • Have you ever been wrong in a disagreement?
    Example strong answer (a fictional story — use your own)

    On a website rebuild, a senior designer wanted an animated, image-heavy homepage, and I was worried it would hurt mobile load times and SEO. As the developer responsible for performance, I needed us to agree before the sprint started. I asked her to walk me through what she was trying to achieve — she wanted the brand to feel premium. I built two quick prototypes, one with her full design and one with lighter animations, and we tested both on a mid-range phone together. Hers took nearly six seconds to load. We agreed on a version that kept the key animation but lazy-loaded the rest. The page launched loading in under two seconds, and she later asked me to review designs earlier. I learned that testing together beats debating.

  • Tell me about a mistake you made and what you learned.

    BeginnerBehavioural

    What the interviewer is evaluating

    Honesty, accountability and learning.

    Key points a strong answer covers

    • Real mistake owned. Own a real mistake.
    • Fixed it. Show how you fixed it and who you told.
    • Changed behaviour. Show what you changed afterwards.

    Suggested answer structure

    1. Situation — one or two sentences of context.
    2. Task — what you were responsible for.
    3. Action — what you did, step by step (say “I”).
    4. Result — what changed, with a number if you can back it up.
    5. Reflection — what you learned or would do differently.

    Common mistakes

    • Choosing a fake mistake like 'I work too hard'.
    • Blaming others.

    Likely follow-up questions

    • How did your manager react?
    • How do you know you haven't repeated it?
    Example strong answer (a fictional story — use your own)

    In my first year as a marketing coordinator, I sent a promotional email to our whole list with the wrong discount code — I'd tested the email but not clicked the code itself. Within an hour customers were complaining that it didn't work. I told my manager immediately, set the wrong code to apply the discount too, and sent a short correction email with an apology. We lost very little revenue, and some customers replied thanking us for the quick fix. Since then I use a pre-send checklist that includes testing every link and code as a customer would, and I asked for a second person to check any campaign to more than 10,000 people.

  • Describe a situation where you worked under pressure or to a tight deadline.

    BeginnerBehavioural

    What the interviewer is evaluating

    Prioritisation, composure and delivery.

    Key points a strong answer covers

    • The pressure. Make the pressure concrete.
    • Prioritised. Show how you prioritised.
    • Communicated. Show how you kept people informed.
    • Delivered. Show the outcome.

    Suggested answer structure

    1. Situation — one or two sentences of context.
    2. Task — what you were responsible for.
    3. Action — what you did, step by step (say “I”).
    4. Result — what changed, with a number if you can back it up.
    5. Reflection — what you learned or would do differently.

    Common mistakes

    • Glorifying working all night as the solution.
    • No mention of prioritising.

    Likely follow-up questions

    • What would you do if it was clear you couldn't make the deadline?
    • How do you stop pressure affecting quality?
    Example strong answer (a fictional story — use your own)

    Two days before a client presentation, our analyst fell ill and I had to finish the market research report she'd been leading. I listed everything left and asked the account director which sections the client cared about most — pricing and competitor comparison. I focused on those, reused verified data from our previous report, and moved the appendix to a follow-up email. I sent a short update each evening so nobody was surprised. We delivered the core report on time, the client approved the next phase, and the appendix followed two days later. I learned to ask early what matters most rather than trying to do everything equally well.

  • What would you do if you realised you were going to miss a deadline?

    BeginnerSituational

    What the interviewer is evaluating

    Transparency and problem solving.

    Key points a strong answer covers

    • Tell people early. Flag it as soon as you know.
    • Assess the gap. Work out how far off you are.
    • Options. Offer options: reduced scope, help, a new date.
    • Prevent repeats. Learn why it happened.

    Suggested answer structure

    1. Clarify the situation and what's at stake.
    2. Say what you'd do first, and why.
    3. Explain who you'd involve and how you'd communicate.
    4. Describe how you'd check the outcome and prevent a repeat.

    Common mistakes

    • Waiting until the deadline to say anything.
    • Promising you'll just work all night.

    Likely follow-up questions

    • What if your manager is unavailable?
    • Has this happened to you?
    Example strong answer

    I'd tell the person depending on it as soon as I realised, not at the deadline. Before that conversation I'd work out how far off I am and why, so I could offer options: delivering the most important part on time and the rest a few days later, getting help from a colleague, or agreeing a new date. Then I'd let them decide what works best for them, and keep them updated. Afterwards I'd look at why it slipped — usually underestimating something — so I plan better next time.

Ready to answer them out loud?

Run a timed devops engineer mock interview, type or speak your answers, and get a score breakdown with what to improve.

Interview questions for related roles