200+ DevOps Interview Questions and Answers (2027)
DevOps interview prep hub: 205 questions with answers for freshers, 2-5 years and seniors, plus scenarios and links to every tool's question bank.
This is our DevOps interview preparation hub: 205 numbered DevOps interview questions with short, direct answers across Linux, Git, CI/CD, Docker, Kubernetes, Terraform, Ansible, cloud, monitoring, security and SRE, grouped for freshers, 2-5 years and senior engineers, plus scenarios. Each topic links to its full question bank so you can go deeper where your interview needs it.
Use this page two ways. Read the 205 questions straight through for a broad revision pass, or use the topic table to jump to the dedicated question bank for each tool. If you only have an hour, start with the 20 most common DevOps interview questions, and if DevOps itself is new to you, read what is DevOps first.
Key takeaways
- DevOps interviews test fundamentals first: Linux, networking, Git and one scripting language come up in almost every round.
- Expect at least one CI/CD pipeline question, one container or Kubernetes question and one infrastructure as code question, whatever the job title says.
- Experienced rounds move from "what is" to "how would you design" and "what would you do when this breaks".
- Answer with the direct point first, then a short example or command. Mention how you would verify the result.
- Go deep on the tools named in the job description using the linked topic banks below.
DevOps interview question banks by topic
Each link goes to the main question bank for that topic. Specialised sets (scenario, advanced, freshers) are linked from inside each bank.
Not sure which skills to focus on? The skills needed to crack DevOps interviews post helps you plan.
DevOps interview questions for freshers
1. What is DevOps?
DevOps is a set of practices and a culture that brings development and operations together to deliver software faster and more reliably, through automation, shared ownership, continuous integration and delivery, and fast feedback from production.
2. Why do companies adopt DevOps?
To release changes more often with fewer failures, recover faster from incidents, and reduce manual work. The DORA research program measures this with deployment frequency, lead time, change failure rate and recovery time.
3. What are the DORA metrics?
Deployment frequency, lead time for changes, change failure rate and time to restore service (now often called failed deployment recovery time). Google's DORA team uses them to measure software delivery performance.
4. What is the difference between Agile and DevOps?
Agile focuses on how teams plan and build software in short iterations. DevOps extends that through release and operations, so working software reaches users and is run reliably.
5. What is CI?
Continuous integration means developers merge small changes to a shared branch often, and every change triggers an automated build and tests, so integration problems surface within minutes.
6. What is the difference between continuous delivery and continuous deployment?
Continuous delivery keeps every change in a releasable state, with a manual approval to go to production. Continuous deployment releases every change that passes the pipeline to production automatically.
7. What is a CI/CD pipeline?
An automated sequence of stages, such as build, test, scan, package and deploy, that runs on each change. Jenkins, GitLab CI/CD, GitHub Actions and Azure Pipelines are common tools.
8. What is infrastructure as code?
Defining servers, networks and services in version-controlled files and creating them with tools like Terraform or Ansible, instead of manual console clicks. It makes environments repeatable and reviewable.
9. What is version control?
A system that records changes to files over time so you can see history, collaborate and roll back. Git is the standard in DevOps.
10. What is the difference between Git and GitHub?
Git is a distributed version control tool that runs locally. GitHub is a hosting service for Git repositories with pull requests, issues and GitHub Actions. GitLab and Bitbucket are alternatives.
11. What does git clone, commit, push and pull do?
clone copies a remote repository, commit records staged changes locally, push sends commits to the remote, and pull fetches and merges remote changes into your branch.
12. What is a branch?
A movable pointer to a line of commits. Teams create feature branches for work in progress and merge them back through pull or merge requests after review and CI.
13. What is the difference between merge and rebase?
Merge joins histories with a merge commit and keeps the original commits. Rebase replays your commits on top of another branch for a linear history. Do not rebase commits others have already pulled.
14. What is a merge conflict and how do you fix it?
Git cannot combine changes to the same lines automatically. Open the conflicted files, choose the correct content between the markers, git add them and complete the merge or rebase.
15. What is trunk-based development?
A branching model where developers merge small changes to the main branch at least daily, using short-lived branches and feature flags. It supports CI better than long-lived feature branches.
16. What is a pull request?
A request to merge a branch, used for code review and automated checks before the change reaches the main branch. GitLab calls it a merge request.
17. What is Linux and why does DevOps rely on it?
Linux is an open source operating system kernel used in most servers, containers and cloud images. DevOps engineers manage Linux daily for builds, deployments and troubleshooting.
18. How do you check disk usage in Linux?
df -h for file systems and du -sh /path for directories. lsblk shows block devices.
19. How do you find which process uses a port?
ss -tulpn | grep :8080 shows the listening process. lsof -i :8080 also works.
20. How do you view logs in Linux?
journalctl -u service for systemd units, tail -f /var/log/messages or /var/log/syslog depending on the distribution, and application log files under /var/log.
21. What do chmod 755 and chown do?
chmod 755 gives the owner read, write and execute and others read and execute. chown user:group file changes ownership.
22. How do you manage services on modern Linux?
With systemd: systemctl start, stop, restart, status and enable to start at boot.
23. What is SSH?
Secure Shell, an encrypted protocol for remote login and command execution, usually on TCP port 22. Key-based authentication is preferred over passwords.
24. What is the difference between TCP and UDP?
TCP is connection oriented and reliable, with ordering and retransmission. UDP is connectionless and faster with no delivery guarantee. HTTP/1.1 and HTTP/2 use TCP; DNS queries usually use UDP.
25. What is DNS?
The Domain Name System translates names like example.com into IP addresses. Common record types are A, AAAA, CNAME, MX, TXT and NS.
26. What happens when you type a URL into a browser?
The browser resolves the name with DNS, opens a TCP connection (and TLS for HTTPS), sends an HTTP request, the server or load balancer responds, and the browser renders the page.
27. What are common HTTP status codes?
200 OK, 301 and 302 redirects, 400 bad request, 401 unauthenticated, 403 forbidden, 404 not found, 500 server error, 502 bad gateway, 503 unavailable and 504 gateway timeout.
28. What is a load balancer?
A component that spreads incoming traffic across multiple servers, checks their health and removes unhealthy ones. Layer 4 balancers route by IP and port; layer 7 by HTTP details like host and path.
29. What is a reverse proxy?
A server that receives client requests and forwards them to backend servers, often adding TLS termination, caching and routing. NGINX and HAProxy are common examples.
30. What is a virtual machine?
A software-emulated computer with its own operating system running on a hypervisor. VMs give strong isolation but are heavier than containers.
31. What is a container?
A lightweight, isolated process that packages an application with its dependencies and shares the host kernel. Containers start fast and run the same way across environments.
32. What is Docker?
A platform for building, shipping and running containers. It includes the Docker Engine, the CLI, Dockerfiles for building images and registries such as Docker Hub.
33. What is the difference between an image and a container?
An image is a read-only template built from a Dockerfile. A container is a running instance of an image with its own writable layer.
34. What is a Dockerfile?
A text file with instructions such as FROM, COPY, RUN and CMD that Docker uses to build an image layer by layer.
35. What is the difference between CMD and ENTRYPOINT?
ENTRYPOINT sets the executable that always runs. CMD provides default arguments, which are replaced by arguments passed to docker run.
36. How do you persist data in Docker?
Use volumes (managed by Docker) or bind mounts (a host path). Data in the container's writable layer is lost when the container is removed.
37. What is Docker Compose?
A tool that defines and runs multi-container applications from a YAML file, with services, networks and volumes, started with docker compose up.
38. What is a container registry?
A storage service for images, such as Docker Hub, Amazon ECR, Google Artifact Registry, Azure Container Registry, GitLab or JFrog Artifactory.
39. What is Kubernetes?
An open source system for deploying, scaling and managing containerised applications across a cluster of machines. It is a graduated CNCF project.
40. What are the main Kubernetes control plane components?
kube-apiserver, etcd, kube-scheduler and kube-controller-manager, plus cloud-controller-manager in cloud clusters. Nodes run kubelet, a container runtime and usually kube-proxy. See the Kubernetes architecture components post.
41. What is a Pod?
The smallest deployable unit in Kubernetes: one or more containers that share a network namespace and storage volumes and are scheduled together.
42. What is a Deployment?
A Kubernetes object that manages ReplicaSets to keep a set number of identical Pods running and performs rolling updates and rollbacks.
43. What is a Service in Kubernetes?
A stable network endpoint for a set of Pods selected by labels. Types include ClusterIP, NodePort, LoadBalancer and ExternalName.
44. What is a namespace?
A way to divide a cluster into virtual groups for teams or environments, with separate names, RBAC and resource quotas.
45. What are ConfigMaps and Secrets?
ConfigMaps hold non-sensitive configuration; Secrets hold sensitive data such as passwords. Both can be mounted as files or exposed as environment variables. Secrets are base64 encoded, not encrypted by default.
46. What is kubectl?
The command-line tool for the Kubernetes API: kubectl get, describe, apply, logs, exec and so on.
47. What is Helm?
A package manager for Kubernetes. Charts bundle templated manifests with default values, and releases can be installed, upgraded and rolled back.
48. What is Terraform?
An infrastructure as code tool from HashiCorp that uses HCL to declare resources across providers, then plans and applies changes while tracking them in a state file.
49. What does terraform plan do?
It compares your configuration with the state and real infrastructure and shows what Terraform will create, change or destroy, without making changes.
50. What is the Terraform state file?
A file mapping configuration to real resources. Teams store it in a remote backend with locking, such as S3 or Terraform Cloud, because it can contain sensitive values.
51. What is Ansible?
An agentless automation tool from Red Hat that connects over SSH (or WinRM) and runs tasks defined in YAML playbooks to configure systems and deploy applications.
52. What is the difference between Ansible and Terraform?
Terraform is best at provisioning infrastructure and tracks it in state. Ansible is best at configuring systems and running procedures. Many teams use Terraform to create VMs and Ansible to configure them.
53. What is an Ansible playbook?
A YAML file with one or more plays, each mapping a group of hosts to an ordered list of tasks that call modules.
54. What is idempotency?
Running the same operation many times gives the same result as running it once. Good Ansible tasks and Terraform configurations are idempotent.
55. What is Jenkins?
An open source automation server for CI/CD. Pipelines are defined in a Jenkinsfile, and plugins extend it with integrations.
56. What is a Jenkinsfile?
A file in the repository that defines a Jenkins pipeline in declarative or scripted Groovy syntax, so the pipeline is versioned with the code.
57. What is GitHub Actions?
GitHub's CI/CD service. Workflows in .github/workflows/*.yml run jobs on GitHub-hosted or self-hosted runners in response to events like pushes and pull requests.
58. What is GitLab CI/CD?
GitLab's built-in CI/CD, defined in .gitlab-ci.yml with stages and jobs that run on GitLab Runners.
59. What is cloud computing?
On-demand access to compute, storage, networking and services over the internet, paid by usage. AWS, Microsoft Azure and Google Cloud are the largest providers.
60. What are IaaS, PaaS and SaaS?
IaaS gives virtual machines and networks (Amazon EC2). PaaS gives a managed platform to run code (Google App Engine). SaaS gives finished software (Gmail).
61. What is a region and an availability zone?
A region is a geographic area with multiple isolated data centre groups called availability zones. Spreading across zones protects against a single data centre failure.
62. What is IAM?
Identity and access management controls who can do what in a cloud account through users, roles, groups and policies. Follow least privilege.
63. What is object storage?
Storage for files as objects with metadata, accessed over HTTP APIs, such as Amazon S3, Azure Blob Storage and Google Cloud Storage.
64. What is serverless?
Running code without managing servers, billed per execution. AWS Lambda, Azure Functions and Google Cloud Run functions are examples.
65. What is monitoring?
Collecting and watching metrics, logs and health checks to detect problems. Tools include Prometheus, Grafana, Datadog, New Relic and the ELK Stack.
66. What is the difference between monitoring and observability?
Monitoring checks known failure conditions. Observability lets you investigate unknown problems using rich metrics, logs and traces. See observability vs monitoring.
67. What is Prometheus?
An open source, pull-based monitoring system and time series database with the PromQL query language and Alertmanager for alerts. It is a graduated CNCF project.
68. What is Grafana?
An open source tool for dashboards and visualisation across data sources such as Prometheus, Loki, Elasticsearch and cloud monitoring services.
69. What is the ELK Stack?
Elasticsearch for search and storage, Logstash for processing and Kibana for visualisation, often with Beats for shipping logs. It is used for centralised logging.
70. What is DevSecOps?
Building security into every stage of the DevOps lifecycle, with automated code scanning, dependency checks, secrets management and policy checks in the pipeline.
71. What is SAST and DAST?
SAST scans source code for vulnerabilities without running it. DAST tests a running application from outside, as an attacker would.
72. Why should secrets not be stored in Git?
Anyone with repository access, or a leaked clone, gets them, and they stay in history. Use a secrets manager such as HashiCorp Vault or a cloud secrets service.
73. What is a microservice?
A small, independently deployable service that owns one business capability and communicates with others over APIs or messages.
74. What is blue-green deployment?
Running two identical environments and switching traffic from the current (blue) to the new (green) version at once, keeping blue ready for a quick rollback.
75. What is a canary release?
Sending a small share of traffic to the new version, watching metrics, and increasing gradually if it is healthy.
76. What is a rolling update?
Replacing instances of the old version with the new one a few at a time, keeping the service available. It is the default Deployment strategy in Kubernetes.
77. What is YAML and why is it common in DevOps?
A human-readable data format used for Kubernetes manifests, Ansible playbooks and CI pipelines. Indentation defines structure, so spacing errors break files.
78. Which scripting languages should a DevOps engineer know?
Bash for Linux automation and Python for tooling and APIs are the most common. Go is useful for Kubernetes tooling, and PowerShell for Windows.
79. What is an artifact repository?
A store for build outputs such as JARs, npm packages and container images, for example JFrog Artifactory or Sonatype Nexus. Pipelines publish once and deploy the same artifact everywhere.
80. What is a shift-left approach?
Moving testing and security checks earlier in the development process, so problems are found when they are cheapest to fix.
DevOps interview questions for 2-5 years experience
81. How would you design a CI/CD pipeline for a microservice?
On each pull request: lint, unit tests, SAST and dependency scan. On merge: build an image tagged with the commit SHA, scan it, push to a registry, deploy to staging, run integration tests, then promote to production with approval or progressive delivery.
82. How do you speed up a slow pipeline?
Cache dependencies, run independent jobs in parallel, split tests, build only changed services in a monorepo, use smaller base images and Docker layer caching, and move slow suites to nightly runs where acceptable.
83. What is a build artifact promotion strategy?
Build once, then promote the same immutable artifact through environments by retagging or moving it between repositories. Rebuilding per environment risks differences.
84. How do you handle secrets in CI/CD?
Store them in the CI tool's secret store or an external manager such as Vault, inject them at runtime, mask them in logs, scope them to environments, and prefer short-lived credentials through OIDC federation with the cloud provider.
85. What is OIDC federation in CI pipelines?
The CI system issues a signed token for each job, and the cloud provider trusts it to grant a short-lived role. GitHub Actions, GitLab and others support this, which removes long-lived cloud keys from CI.
86. How do Jenkins agents work?
The controller schedules work, and agents run builds. Agents can be static machines, Docker containers or Kubernetes pods created per build. Avoid running builds on the controller.
87. What are Jenkins shared libraries?
Reusable Groovy code stored in a separate repository and loaded by Jenkinsfiles, so many pipelines share standard steps.
88. How do GitHub Actions reusable workflows help?
A workflow can call another workflow with workflow_call, so teams maintain one standard build or deploy workflow and reuse it across repositories.
89. What is a Git hook?
A script Git runs on events such as pre-commit or pre-push. Teams use pre-commit hooks for linting and secret scanning before code leaves the laptop.
90. How do you undo a commit already pushed to a shared branch?
Use git revert <sha>, which creates a new commit that undoes the change. Avoid reset and force push on shared branches.
91. How do you write a production-ready Dockerfile?
Use a small, pinned base image, multi-stage builds, order layers for caching, run as a non-root user, add a .dockerignore, avoid secrets in layers, and define a health check where the platform uses it.
92. What is a multi-stage build?
A Dockerfile with several FROM stages, where you build in one stage and copy only the output into a smaller final image without build tools.
93. How do you reduce image size?
Use slim or distroless base images, multi-stage builds, combine and clean up package installs in one layer, and exclude unneeded files with .dockerignore.
94. How do you scan container images?
Run scanners such as Trivy or Grype in CI, or use registry scanning, fail builds on critical vulnerabilities with fixes available, and rebuild images regularly to pick up patched base layers.
95. What are liveness, readiness and startup probes?
Liveness restarts a stuck container. Readiness removes a Pod from Service endpoints until it can serve traffic. Startup delays the other probes for slow-starting apps.
96. What are resource requests and limits?
Requests are what the scheduler reserves for a container; limits are the maximum it can use. Exceeding a memory limit gets the container OOM killed; exceeding CPU limits causes throttling.
97. What is the Horizontal Pod Autoscaler?
A controller that scales a workload's replicas based on CPU, memory or custom and external metrics, using the metrics APIs.
98. What is the difference between a Deployment and a StatefulSet?
Deployments manage interchangeable Pods. StatefulSets give each Pod a stable name, ordered start and stop, and its own persistent volume, which suits databases and clustered apps.
99. What is a DaemonSet?
A workload that runs one Pod on each (or selected) node, used for log shippers, monitoring agents and network plugins.
100. What is an Ingress and an Ingress controller?
An Ingress defines HTTP routing rules by host and path. An Ingress controller, such as ingress-nginx or a cloud controller, implements them. The Gateway API is the newer, more expressive alternative.
101. What is a PersistentVolume and PersistentVolumeClaim?
A PV is storage in the cluster; a PVC is a request for storage by a Pod. StorageClasses let PVCs provision volumes dynamically.
102. How does Kubernetes RBAC work?
Roles and ClusterRoles define allowed verbs on resources. RoleBindings and ClusterRoleBindings grant them to users, groups or ServiceAccounts. Grant the minimum needed.
103. What are NetworkPolicies?
Rules that control which Pods can talk to each other and to external endpoints. They need a CNI plugin that enforces them, such as Calico or Cilium.
104. How do you troubleshoot a Pod in CrashLoopBackOff?
Run kubectl describe pod for events and exit codes, kubectl logs --previous for the last crash output, and check config, Secrets, probes and resource limits.
105. What does ImagePullBackOff mean?
The node cannot pull the image: wrong name or tag, missing registry credentials (imagePullSecrets), or network access to the registry blocked.
106. What is GitOps?
Using Git as the source of truth for desired cluster state, with an agent such as Argo CD or Flux that pulls and applies changes and reports drift.
107. How does Argo CD detect drift?
It compares live resources with the manifests rendered from Git and marks the application OutOfSync. With auto-sync and self-heal, it reverts manual changes.
108. How do you manage Helm values across environments?
Keep a base values.yaml and per-environment override files, pass them with -f, and keep secrets out of values files by using a secrets operator or external secret store.
109. What is a Terraform module?
A reusable package of Terraform configuration with input variables and outputs, used to standardise patterns like a VPC or a Kubernetes cluster.
110. How do you manage Terraform state for a team?
Use a remote backend with locking and encryption, separate state per environment or component, restrict access to state, and never edit it by hand except with terraform state commands.
111. What is terraform import?
It brings existing resources under Terraform management by adding them to state. Recent Terraform versions also support import blocks in configuration.
112. How do you detect infrastructure drift with Terraform?
Run terraform plan regularly (for example a scheduled CI job) and alert when it shows changes that are not in Git.
113. What are Terraform workspaces?
Separate state instances for the same configuration. Many teams prefer separate directories or stacks per environment for clearer isolation.
114. What are Ansible roles?
A standard structure for tasks, handlers, templates, variables and defaults so automation can be reused and shared, for example through Ansible Galaxy.
115. What are Ansible handlers?
Tasks that run only when notified by a change, such as restarting a service after its config file changes, and run once at the end of a play.
116. How do you protect secrets in Ansible?
Encrypt variables with Ansible Vault, or look them up at runtime from an external secrets manager, and use no_log: true on sensitive tasks.
117. What is an Ansible dynamic inventory?
An inventory generated from a source such as AWS, Azure or VMware through inventory plugins, so hosts are discovered rather than listed by hand.
118. How do you design a VPC for a three-tier app on AWS?
Public subnets for load balancers, private subnets for app servers and isolated subnets for databases across at least two availability zones, with NAT for outbound traffic, security groups per tier and VPC endpoints for AWS services.
119. What is the difference between security groups and NACLs in AWS?
Security groups are stateful and attached to resources, with allow rules only. Network ACLs are stateless, apply to subnets and support allow and deny rules.
120. What is an IAM role and why prefer it over access keys?
A role grants temporary credentials to services, instances or federated users. Roles avoid long-lived keys that can leak.
121. How do you make an application highly available in the cloud?
Run multiple instances across availability zones behind a load balancer, use managed databases with multi-zone replicas, automate health checks and replacement, and keep state out of instances.
122. What is autoscaling?
Adding or removing capacity automatically based on metrics or schedules, such as AWS Auto Scaling groups or the Kubernetes HPA and cluster autoscaler.
123. What is the difference between vertical and horizontal scaling?
Vertical scaling gives one machine more CPU or memory. Horizontal scaling adds more machines or instances, which also improves availability.
124. How do you control cloud costs?
Tag resources by owner, right-size instances, use autoscaling, buy savings plans or committed use discounts for steady load, use spot instances for fault-tolerant work, clean up idle resources and set budget alerts.
125. What is a service mesh?
An infrastructure layer, such as Istio or Linkerd, that handles service-to-service traffic with mTLS, retries, traffic splitting and telemetry, usually through sidecar or node-level proxies.
126. What is an API gateway?
A front door for APIs that handles routing, authentication, rate limiting and transformations, such as Kong, Amazon API Gateway or Apigee.
127. What is PromQL used for?
Querying Prometheus time series, for example rate(http_requests_total[5m]) for request rate, in dashboards and alert rules.
128. Why use rate() on counters in Prometheus?
Counters only go up and reset on restart. rate() calculates the per-second increase over a window and handles resets.
129. What makes a good alert?
It is actionable, tied to user impact, has a clear owner and runbook link, and fires rarely enough that people respond. Alert on symptoms; use dashboards for causes.
130. What is centralised logging?
Shipping logs from all hosts and containers to one system, such as ELK, Loki, Splunk or a SaaS tool, so you can search across services during incidents.
131. What is distributed tracing?
Following a request across services by passing a trace ID, so you can see where time was spent. OpenTelemetry is the CNCF standard for instrumentation.
132. What is OpenTelemetry?
A CNCF project providing vendor-neutral APIs, SDKs and the Collector for generating and exporting traces, metrics and logs to many backends.
133. What are SLIs, SLOs and SLAs?
An SLI measures service behaviour, such as the success ratio. An SLO is the target for it, such as 99.9%. An SLA is a contract with consequences if targets are missed.
134. What is an error budget?
The allowed unreliability under an SLO. At 99.9% monthly, about 43 minutes of downtime. When the budget is spent, teams slow releases and focus on reliability.
135. What is a blameless postmortem?
A review after an incident that records the timeline, impact, causes and action items, focusing on system and process fixes rather than blaming individuals.
136. What is chaos engineering?
Running controlled experiments that inject failures, such as killing instances or adding latency, to confirm a system tolerates them. Start small and in non-production.
137. How do you scan dependencies for vulnerabilities?
Use software composition analysis tools such as Dependabot, Snyk, OWASP Dependency-Check or Trivy in CI, and fail builds on serious issues with fixes available.
138. What is an SBOM?
A software bill of materials lists the components and versions in a build. Formats include SPDX and CycloneDX. It helps you find affected services when a new vulnerability appears.
139. What is image signing?
Cryptographically signing container images, for example with Sigstore cosign, and verifying signatures at deploy time with an admission policy so only trusted images run.
140. What is policy as code?
Writing rules, such as "no privileged containers", in code with tools like OPA Gatekeeper or Kyverno and enforcing them in CI or at the Kubernetes admission stage.
141. What is SonarQube used for?
Static analysis of code quality and security, with quality gates that can block a merge when new code adds bugs, vulnerabilities, duplications or low test coverage.
142. What is the difference between unit, integration and end-to-end tests?
Unit tests check small pieces in isolation. Integration tests check components working together. End-to-end tests check full user flows through the deployed system.
143. What is a feature flag?
A runtime switch that turns code paths on or off without redeploying. It separates deployment from release and allows gradual rollouts.
144. How do you run database migrations in CI/CD?
Use a migration tool such as Flyway or Liquibase, run migrations as a separate pipeline step before the app rollout, and make changes backward compatible (expand, migrate, contract) so old and new versions both work.
145. What is configuration drift?
When the real state of servers differs from the intended configuration because of manual changes. IaC, immutable infrastructure and regular drift checks prevent it.
146. What is immutable infrastructure?
Replacing servers or containers with new ones built from a versioned image instead of changing them in place, which keeps environments consistent.
147. How would you write a script to check if a service is up and restart it?
#!/bin/bash
if ! systemctl is-active --quiet nginx; then
systemctl restart nginx
logger "nginx was down and was restarted"
fi
In production, prefer systemd's own Restart= policy and alerting over cron scripts.
148. How do you parse JSON in shell scripts?
Use jq, for example kubectl get pods -o json | jq -r '.items[].metadata.name'.
149. How would you use Python in DevOps?
Automating cloud APIs with SDKs such as boto3, writing CLI tools, parsing logs, glue code in pipelines, and testing infrastructure. See our Python for DevOps questions.
150. What is load testing?
Sending realistic traffic to a system to measure latency, throughput and errors at expected and peak load. Tools include k6, JMeter, Gatling and Locust.
151. What is the difference between a process and a thread?
A process has its own memory space. Threads run inside a process and share its memory, which makes communication fast but needs care with shared state.
152. What is the load average in Linux?
The average number of processes running or waiting for CPU (and on Linux, uninterruptible I/O) over 1, 5 and 15 minutes. Compare it with the number of CPU cores.
153. What is an inode?
A data structure storing a file's metadata and data block locations. A file system can run out of inodes before disk space if it holds millions of small files.
154. What is a zombie process?
A process that has exited but whose parent has not read its exit status. It uses no resources besides a process table entry; fix the parent process.
155. What is TLS?
Transport Layer Security encrypts traffic between client and server and authenticates the server with a certificate. TLS 1.3 is defined in RFC 8446.
156. What is mTLS?
Mutual TLS, where both client and server present certificates, so each side authenticates the other. Service meshes use it between services.
157. What is a CIDR block?
A notation for IP ranges, such as 10.0.0.0/16, where the number after the slash is the prefix length. A /24 has 256 addresses.
158. What is NAT?
Network address translation maps private IP addresses to a public one, letting private instances reach the internet without being directly reachable.
159. How do you back up a Kubernetes cluster?
Back up etcd for self-managed control planes, keep manifests in Git, and use a tool such as Velero to back up resources and persistent volumes. Test restores regularly.
160. How do you upgrade a Kubernetes cluster?
Read the release notes for removed APIs, upgrade the control plane one minor version at a time, then node pools with drain and cordon, respecting PodDisruptionBudgets, and test in staging first.
Senior DevOps interview questions
161. How would you build a platform for 50 development teams?
Offer self-service golden paths: templates for new services, standard CI/CD, Kubernetes namespaces with quotas, observability by default, and policy guardrails. Treat the platform as a product with users, a roadmap and feedback.
162. What is platform engineering?
Building and running an internal developer platform that gives teams self-service tools and paved paths, so they ship without needing deep infrastructure knowledge.
163. How do you choose between Kubernetes, serverless and VMs?
Match the workload. Serverless suits event-driven, spiky work with little ops effort. Kubernetes suits many services needing portability and control. VMs suit legacy or special requirements. Factor in team skills and cost.
164. How do you design multi-region deployments?
Decide active-active or active-passive based on RTO and RPO, replicate data with conflict handling, route users with DNS or global load balancing, deploy the same artifacts through the same pipeline per region, and rehearse failover.
165. What are RTO and RPO?
Recovery time objective is how long a service can be down. Recovery point objective is how much data loss, measured in time, is acceptable. They drive backup and DR design.
166. How do you secure the software supply chain?
Protect source branches, use reviewed and pinned dependencies, build in isolated runners, generate SBOMs and provenance (SLSA is a useful framework), sign artifacts, verify signatures at deploy, and limit who can change pipelines.
167. How do you enforce standards across many Terraform repositories?
Publish versioned modules from a private registry, add policy checks (OPA, Sentinel or checkov) in CI, require plan review, and track module versions to drive upgrades.
168. How do you measure the success of a DevOps transformation?
Track the DORA metrics over time, plus developer experience signals such as time to first deploy for new engineers, and reliability against SLOs. Avoid vanity metrics like number of pipelines.
169. How do you reduce toil?
Measure where engineers spend time on manual, repetitive operational work, automate the largest items, eliminate unnecessary alerts, and give teams self-service tools. Google's SRE book recommends capping toil.
170. How do you run on-call well?
Keep rotations humane, alert only on actionable user-facing symptoms, maintain runbooks, review every page, compensate time and fix recurring causes.
171. How do you handle a production incident as incident commander?
Declare the incident and severity, assign roles (commander, communications, operations), focus on mitigation before root cause, communicate on a regular schedule, record the timeline and run a blameless review afterwards.
172. How do you design observability for a new system?
Instrument with OpenTelemetry, define SLIs and SLOs before launch, standardise labels (service, env, version), link logs to traces, build service dashboards with golden signals, and alert on SLO burn rates.
173. How do you manage secrets at scale?
Use a central secrets manager with identity-based access (Vault, cloud secret managers), dynamic short-lived credentials where possible, automatic rotation, audit logs, and sync into Kubernetes with an operator rather than storing them in Git.
174. How do you approach Kubernetes multi-tenancy?
Namespaces per team with RBAC, quotas and limit ranges, NetworkPolicies, Pod Security admission, policy engines for guardrails, and separate clusters where strong isolation or compliance demands it.
175. How do you handle a monolith to microservices migration?
Split gradually with the strangler pattern, start with well-bounded domains, give each service its own data, invest early in CI/CD and observability, and keep the monolith deployable throughout.
176. How do you make deployments safer for critical services?
Progressive delivery (canary or blue-green) with automated analysis of metrics, feature flags, fast rollback, deployment freezes for risky periods and small, frequent changes.
177. How do you plan capacity?
Use historical usage and growth trends, load test to find limits per instance, keep headroom for spikes and failures, and review regularly with forecasts tied to business events.
178. How do you balance speed and stability?
Use error budgets: while the SLO is met, teams ship freely; when the budget is exhausted, reliability work takes priority. This makes the trade-off explicit.
179. How do you evaluate a new DevOps tool?
Define the problem first, compare a few options against requirements (integration, security, cost, support, community), run a time-boxed proof of concept with a real team, and plan migration and exit costs.
180. How do you manage cost in Kubernetes?
Set requests from real usage, use the cluster autoscaler or Karpenter on AWS, bin-pack nodes, use spot nodes for tolerant workloads, and allocate costs by namespace or label with tools such as OpenCost.
181. How do you handle compliance requirements in pipelines?
Encode controls as automated checks (scans, policy, approvals), keep audit trails of who approved and deployed what, separate duties for production changes, and produce evidence automatically from pipeline logs.
182. How do you design a disaster recovery test?
Pick a realistic failure (region loss, database corruption), define success against RTO and RPO, run it in a controlled window, time each step, and turn gaps into action items.
183. How do you mentor junior DevOps engineers?
Pair on real tasks, give them ownership of small services, review their changes with explanations, include them in incident reviews and encourage written runbooks.
184. How do you handle disagreement between dev and ops teams on a release?
Bring it back to data: SLOs, error budget, test results and risk. Agree on criteria for go or no-go in advance, so the decision is not about opinions.
185. What is your approach to documentation?
Keep docs close to code (README, ADRs, runbooks in the repo), document decisions and operations rather than obvious steps, and review docs during incidents and onboarding.
Scenario-based DevOps interview questions
186. A deployment to production failed halfway. What do you do?
Stop the rollout, roll back to the last known good version, confirm service health with metrics, communicate status, then investigate logs and the change in a calm review.
187. The site is slow after a release, but no errors appear.
Compare latency by endpoint before and after, check traces for the slow span (database, external call), look at resource saturation, and roll back if the impact is significant while you investigate.
188. A Kubernetes node shows NotReady.
Run kubectl describe node for conditions, check kubelet and container runtime logs on the node, disk and memory pressure, and network to the API server. Cordon and drain if it will not recover quickly.
189. Pods are Pending.
Check events with kubectl describe pod: insufficient CPU or memory, node selectors or taints that do not match, or unbound PVCs. Scale nodes or adjust requests and scheduling rules.
190. The Jenkins build passes locally but fails in CI.
Compare environments: tool versions, environment variables, credentials, network access, and case sensitivity of file names. Run the build in the same container image locally.
191. Terraform apply fails with a state lock error.
Another run holds the lock, or a previous run crashed. Confirm no apply is running, then release it with terraform force-unlock LOCK_ID carefully.
192. Someone changed a cloud resource manually and Terraform wants to revert it.
Find out why. If the change is needed, update the code to match and apply; if not, let Terraform revert it. Tighten console permissions to prevent repeats.
193. A disk is filling up on a production server.
Find the cause with du, clean safely (rotate or compress logs, clear caches), check for deleted but open files with lsof +L1, extend the volume if needed, and add monitoring and log rotation.
194. An application cannot connect to the database after a network change.
Test DNS resolution and port reachability (nc -zv host 5432), check security groups, firewalls and NetworkPolicies, and confirm credentials and TLS settings did not change.
195. A secret was committed to a public repository.
Revoke and rotate it immediately, check logs for misuse, remove it from history if required, and add secret scanning to pre-commit and CI.
196. Alert noise is overwhelming the on-call team.
Review which alerts led to action, delete or downgrade the rest, group related alerts, tune thresholds and durations, and move to SLO-based alerts.
197. A Docker container exits immediately after starting.
Check docker logs and the exit code, confirm the main process runs in the foreground, and verify the command, environment variables and mounted files.
198. Production and staging behave differently.
Compare config, secrets, data volume, versions of dependencies, infrastructure size and feature flags. Use IaC and the same artifacts to close the gaps.
199. A third-party API your service depends on is down.
Fail gracefully with timeouts, retries with backoff, circuit breakers and cached or degraded responses, communicate impact, and monitor the dependency separately.
200. The pipeline takes 45 minutes and developers complain.
Measure each stage, then cache, parallelise, split tests, skip unaffected services and move slow checks to later stages. Set a target, such as under 10 minutes for pull request feedback.
201. A memory leak causes pods to be OOM killed every few hours.
Confirm with memory metrics and OOMKilled status, capture a heap profile, roll back if a recent change caused it, and set limits and alerts while the fix is developed.
202. An expired TLS certificate took down a service.
Renew and deploy it, then automate issuance and renewal (cert-manager or ACME clients) and alert on certificates expiring within 30 days.
203. You must cut cloud costs by 20% without hurting reliability.
Find the biggest spenders by tag, remove idle resources, right-size, use commitments for steady load and spot for tolerant work, tune storage classes and retention, and track savings monthly.
204. A developer needs production access to debug.
Grant time-limited, audited access through a just-in-time process, prefer read-only and observability tools, and improve logs and tracing so production access is needed less often.
205. You join a team with no CI/CD. Where do you start?
Put everything in Git, add a basic pipeline that builds and runs tests on every change, then automated deployment to a test environment, then production with approvals. Add IaC and monitoring step by step, measuring DORA metrics from the start.
What interviewers check in each topic
The questions above give breadth. This section explains what a good answer shows in each area, so you know how deep to go in the linked question banks.
Linux and networking
Interviewers want proof you can work on a server without a GUI. Expect questions on permissions, processes, systemd, disk space, logs and package management, then a troubleshooting task such as "a service will not start" or "the disk is full". For networking, know how DNS, TCP, TLS, HTTP status codes and load balancers fit together, and be able to explain what happens between typing a URL and seeing a page. Show the commands you would run and in what order. The Linux system admin bank and the RHCSA questions cover this in depth.
Git and source control
Most candidates can commit and push. Interviewers look for safe habits: branching strategy, pull request reviews, resolving conflicts, reverting rather than force pushing on shared branches, and keeping secrets out of history. Senior candidates are asked how branching affects CI and release frequency, and how they would protect the main branch with required checks and reviews.
CI/CD pipelines
Expect to design a pipeline on a whiteboard. A strong answer names the stages, explains what fails the build, shows where security scans run, builds the artifact once and promotes it, and includes rollback. Be ready to explain how you speed up a slow pipeline and how you keep secrets out of logs. Whichever tool you used (Jenkins, GitLab CI/CD, GitHub Actions, Azure Pipelines, Harness), explain the concepts so they transfer to the tool the employer uses.
Containers
Docker questions move quickly from "what is a container" to writing a good Dockerfile: multi-stage builds, small base images, non-root users, layer caching and image scanning. Troubleshooting questions cover containers that exit immediately, cannot reach each other, or lose data. Explain the difference between volumes and bind mounts and why images should be immutable and tagged by version or commit.
Kubernetes
Kubernetes rounds usually include architecture (control plane and node components), core objects (Pods, Deployments, Services, Ingress, ConfigMaps, Secrets), and at least one broken workload to debug: CrashLoopBackOff, ImagePullBackOff, Pending pods or a Service with no endpoints. Experienced candidates get questions on RBAC, NetworkPolicies, autoscaling, upgrades and GitOps. Use kubectl describe, events and logs in your answers, because that is what interviewers expect you to reach for first.
Infrastructure as code
For Terraform, know the workflow (init, plan, apply), state and remote backends with locking, modules, variables and outputs, and how to handle drift and imports. For Ansible, know inventories, playbooks, roles, handlers, idempotency and Vault. A common question asks when to use Terraform and when to use Ansible; the honest answer is that many teams use both, for provisioning and configuration respectively.
Cloud platforms
Interviewers test whether you can build a secure, highly available setup on one provider: networking (VPCs, subnets, routing), identity (roles and least privilege), compute choices, storage, managed databases, load balancing and autoscaling. Cost awareness is increasingly expected. Pick the provider named in the job description and go deep with the AWS, Azure DevOps or Google Cloud banks.
Monitoring and observability
Expect to explain metrics, logs and traces, what you would alert on, and how you would investigate a slowdown. Know at least one stack well, such as Prometheus with Grafana, the ELK Stack, or a SaaS tool like Datadog or New Relic. Senior candidates are asked about SLOs, error budgets, alert fatigue and OpenTelemetry. Good answers start from user impact and move to causes.
Security
DevSecOps questions cover secrets management, dependency and image scanning, SAST and DAST, least-privilege IAM, network segmentation, and supply chain controls like SBOMs and image signing. Interviewers want to hear that security checks are automated in the pipeline, with clear rules on what blocks a release, rather than a manual review at the end.
SRE and incident response
Expect questions about how you handled a real incident: how you found out, what you did first, how you communicated and what changed afterwards. Know SLIs, SLOs, error budgets, toil, on-call practices and blameless postmortems. A calm, ordered story matters more than a dramatic one.
Behavioural questions
Most DevOps loops include questions about collaboration and ownership: a disagreement with a developer, a time you broke production, how you introduced a new tool. Use a simple structure (situation, what you did, result, what you learned) and be specific about your own part.
A four-week revision plan
| Week | Focus | Practice task |
|---|---|---|
| 1 | Linux, networking, Git, scripting (questions 1-30, 147-158) | Troubleshoot a broken service on a VM; write a Bash health-check script |
| 2 | CI/CD, Docker, artifacts (questions 5-16, 31-38, 81-94) | Build a pipeline that tests, builds and scans a container image |
| 3 | Kubernetes, Helm, GitOps, IaC (questions 39-54, 95-117) | Deploy the image to a local cluster with Helm; create the infrastructure with Terraform |
| 4 | Cloud, monitoring, security, SRE, scenarios (questions 59-72, 118-205) | Add Prometheus and Grafana, define one SLO, and rehearse five scenario answers aloud |
Adjust the plan to the job description. A platform role weights Kubernetes and IaC more heavily; a release engineering role weights CI/CD and Git; an SRE role weights monitoring and incidents.
How to use this hub to prepare
Read the job description and mark every tool it names. Use this page for breadth, then spend most of your time in the topic banks for those tools, especially their scenario sets. Practise answers aloud, and build at least one small project you can explain end to end: a repository with a pipeline that builds a container, deploys to Kubernetes with Terraform-built infrastructure, and has monitoring.
If you want guided practice, our DevOps training covers these tools in a classroom in Kharadi, Pune and live online across India. For Kubernetes-focused roles, see the CKA training.
FAQ
What topics are covered in DevOps interviews?
Linux, networking, Git, scripting, CI/CD, Docker, Kubernetes, Terraform, Ansible, a cloud platform, monitoring and logging, security basics and SRE ideas such as SLOs and incident response.
How should freshers prepare for DevOps interviews?
Get strong at Linux, Git and one scripting language, learn Docker and basic Kubernetes, build one CI/CD project end to end, and practise explaining it. Start with the freshers section above.
What do experienced DevOps interviews focus on?
Design and troubleshooting: pipeline architecture, Kubernetes operations, Terraform state and modules, security in the pipeline, observability and how you handled real incidents.
Which DevOps tools should I learn first?
Linux, Git, a CI tool (Jenkins, GitHub Actions or GitLab CI/CD), Docker, Kubernetes, Terraform and one cloud provider. Add monitoring with Prometheus and Grafana.
How many DevOps interview questions are in this guide?
205 numbered questions with answers: 80 for freshers, 80 for 2-5 years experience, 25 senior questions and 20 scenarios, plus links to dedicated banks for each tool.
Where can I find questions for one specific tool?
Use the topic table near the top of this page. Each row links to the main question bank for that tool, with scenario and advanced sets linked from there.
Are scenario questions important in DevOps interviews?
Yes. Most experienced rounds include troubleshooting scenarios. Interviewers want to hear a calm, ordered approach: mitigate first, gather evidence, fix, then prevent repeats.
Is this the same as the 20 most common DevOps questions post?
No. That post is a short list for quick revision. This hub has 205 questions across levels and links to every topic's full question bank.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0