Skip to content
TryHired.
Interview prep · Technical

DevOps interview questions: answers from CI/CD to incident response

Pipelines, infrastructure as code, deployment strategies and reliability, explained in plain words with example pipeline and Terraform files.

Updated Nov 12, 2026 · Examples are configuration and formulas, not executed · questions: TryHired
Quick answer

DevOps interviews check how you ship and run software: continuous integration and delivery, infrastructure as code, deployment strategies (rolling, blue-green, canary), monitoring and observability, secrets, reliability targets (SLIs, SLOs, error budgets) and how you handle incidents. Below are 19 questions from basic to advanced with short answers and example configuration.

Basic

Basic devops interview questions

Advice

Basic1. What is DevOps?

DevOps is a way of working in which the people who build software and the people who run it share responsibility for delivering it, supported by automation: automated tests and builds, infrastructure as code, automated deployments and good monitoring. The goal is to ship small changes often and safely, and recover quickly when something breaks.

Basic2. What is the difference between continuous integration, continuous delivery and continuous deployment?

Continuous integration means merging small changes often and running automated builds and tests on each one. Continuous delivery means every change that passes is ready to release, with a manual decision to deploy. Continuous deployment goes one step further: every passing change is deployed to production automatically.

Basic3. What does a CI/CD pipeline look like?

A typical pipeline checks out the code, installs dependencies, runs linters and tests, builds an artifact or container image, scans it, pushes it to a registry, deploys to a test environment, runs further checks and then promotes the same artifact to production.

YAML (GitHub Actions) · Example (not executed)
name: ci
on:
  push:
    branches: [main]
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - run: pip install -r requirements.txt
      - run: pytest -q
  image:
    needs: test
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t registry.example.com/api:${{ github.sha }} .

Basic4. What is infrastructure as code?

Infrastructure as code means describing servers, networks and services in versioned files that a tool applies, instead of clicking in a console. Changes are reviewed, repeatable and easy to recreate in another environment. Terraform, CloudFormation and Pulumi are common examples.

HCL (Terraform) · Example (not executed)
resource "aws_s3_bucket" "logs" {
  bucket = "example-app-logs"
}

resource "aws_s3_bucket_versioning" "logs" {
  bucket = aws_s3_bucket.logs.id
  versioning_configuration {
    status = "Enabled"
  }
}

Basic5. What is the difference between trunk-based development and GitFlow?

In trunk-based development everyone merges small changes into the main branch at least daily, using feature flags to hide unfinished work; it suits continuous delivery. GitFlow uses long-lived develop and release branches with feature branches merged in batches; it suits scheduled releases but slows integration.

Basic6. What are rolling, blue-green and canary deployments?

A rolling deployment replaces instances a few at a time. Blue-green runs the new version alongside the old and switches all traffic at once, which makes rollback a quick switch back. A canary sends a small share of traffic to the new version first and widens it only if metrics stay healthy.

Basic7. What is the difference between monitoring and observability?

Monitoring watches known signals and alerts when they cross thresholds. Observability is the ability to ask new questions about a system from its outputs: metrics (numbers over time), logs (events) and traces (a request's path through services). Good observability helps you debug failures nobody predicted.

Basic8. Why do containers matter for DevOps?

A container image packages an app with its dependencies, so the same artifact runs in testing and production. That removes many environment differences and makes deployments, rollbacks and scaling repeatable.

Intermediate

Intermediate devops interview questions

Advice

Intermediate9. What are the DORA metrics?

DORA's four key metrics are deployment frequency, lead time for changes, change failure rate and the time it takes to restore service after a failure. Together they measure both speed and stability of delivery.

Intermediate10. What is the difference between configuration management and provisioning tools?

Provisioning tools such as Terraform create the infrastructure itself (networks, servers, databases). Configuration management tools such as Ansible, Puppet and Chef configure what runs on servers (packages, files, services). Both aim to be idempotent: running them again changes nothing if the system already matches.

Intermediate11. How do you manage secrets in pipelines and apps?

Keep secrets out of source control and images. Store them in a secrets manager (such as HashiCorp Vault or a cloud secrets service), give pipelines and workloads short-lived credentials through their identity, rotate secrets, and scan repositories for leaked keys.

Intermediate12. What are SLIs, SLOs, SLAs and error budgets?

An SLI is a measurement of service health, such as the share of requests served successfully. An SLO is the target for it, such as 99.9% over 30 days. An SLA is a contract with consequences if the target is missed. The error budget is the failure the SLO allows; when it is spent, teams slow feature releases and focus on reliability.

Intermediate13. How do you plan a rollback?

Deploy versioned, immutable artifacts so the previous version is one step away, keep database changes backward compatible (expand, migrate, then contract), use feature flags to switch behavior off without a deploy, and practice rolling back so it works under pressure.

Intermediate14. What is DevSecOps, or shifting security left?

It means building security checks into the delivery process instead of leaving them to a final review: static analysis, dependency and image scanning, secret scanning and infrastructure policy checks run in the pipeline, so problems are caught when they are cheapest to fix.

Intermediate15. What is immutable infrastructure?

Instead of patching running servers in place, you build a new image or container with the change and replace the old instances. Servers never drift from their definition, and rolling back means redeploying the previous image.

Advanced

Advanced devops interview questions

Advice

Advanced16. How do you run an incident and a postmortem?

During an incident: declare it, assign an incident commander, communicate status, mitigate first (roll back, fail over, scale) and diagnose second. Afterwards, write a blameless postmortem: timeline, impact, root causes and contributing factors, and action items with owners, focused on improving systems rather than blaming people.

Advanced17. Why does Terraform keep state, and why lock it?

Terraform's state file maps the resources in your code to the real resources it created, so it can plan changes. Teams store state remotely (for example in an S3 bucket or Terraform Cloud) so everyone uses the same copy, and lock it so two runs cannot change the same infrastructure at once and corrupt it. State can contain secrets, so access must be restricted.

Advanced18. What is GitOps?

In GitOps, a Git repository holds the desired state of the environment, and an agent in the cluster (such as Argo CD or Flux) continuously pulls and applies it. Every change goes through a commit and review, the history is the audit log, and drift is corrected automatically.

Advanced19. Design a CI/CD pipeline for a microservice.

On each pull request: lint, unit tests and a build. On merge: build one immutable image tagged with the commit, scan it, push it, deploy to staging with infrastructure as code or GitOps, run integration and smoke tests, then promote the same image to production with a canary and automatic rollback on error-rate or latency alarms. Keep secrets in a manager and record every deploy.

Practice

How to practice with this page

Advice
  • Build a small pipeline that tests, builds an image and deploys it to a test environment.
  • Describe one incident you handled: detection, mitigation, root cause, follow-up.
  • Be ready to compare two tools you have used and say why you chose one.
  • Know your team's numbers in words: how often you deploy and how fast you recover.
Next

Related interview prep

Disclosure: TryHired makes HIRED, a paid job-search program, so we have a conflict of interest when we mention it. This question bank is free, with no TryHired signup.

FAQ

Questions people ask

What DevOps questions are asked in interviews?
CI/CD, infrastructure as code, Git workflows, deployment strategies, containers and Kubernetes, monitoring and observability, secrets, SLOs and incident response, plus questions about tools you have used.
Is DevOps a role or a culture?
Both terms are used. Many companies hire DevOps, platform or site reliability engineers, but the practice itself is shared ownership of delivery and operations.
Which tools should I learn for a DevOps interview?
Git, one CI system (such as GitHub Actions, GitLab CI or Jenkins), Docker, Kubernetes, Terraform and one cloud provider cover most job descriptions.
How is SRE different from DevOps?
Site reliability engineering, from Google, is one concrete way to practice DevOps, built around SLOs, error budgets, automation and limits on manual operations work.
How do I explain my DevOps experience?
Use the STAR method: the situation, what you automated or fixed, the tools and decisions, and a result you can support, such as faster deployments.
Method

How this page is built

TryHired wrote these questions and answers. Blocks marked Example (not executed) are configuration, commands or formulas that cannot run on the build machine: no output is claimed for them. The question list is general practice: it does not predict what a particular employer will ask.

What this page can't tell you
  • Interviewers ask different questions for different roles and levels.
  • Answers are short explanations, not complete references.
  • Tool choices differ by company; interviewers care more about reasons than brand names.
Sources
  1. DORA, the four key metrics: https://dora.dev/guides/dora-metrics-four-keys/
  2. Google SRE book, service level objectives: https://sre.google/sre-book/service-level-objectives/
  3. GitHub Actions documentation, workflow syntax: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
  4. Terraform documentation, state: https://developer.hashicorp.com/terraform/language/state