DevOps Interview Questions & Answers
All 200 unique questions in one place — 60 easy, 95 medium, 45 hard — grouped by topic.
Practise by topic
Practise the way your interview works
Explain Linux file permissions and what chmod 755 means.
Show answer
What is the difference between a hard link and a soft link?
Show answer
How do you manage a service with systemd?
Show answer
What is the difference between kill, kill -15 and kill -9?
Show answer
Explain stdin, stdout, stderr and what 2>&1 means.
Show answer
How do you schedule a cron job to run every day at 2:30 AM?
Show answer
Your app fails to start with 'address already in use' on port 8080. What do you do?
Show answer
What is the difference between sudo and su?
Show answer
Why do you want to build a career in DevOps?
Show answer
What is an inode in Linux?
Show answer
What is load average in Linux and how do you read it?
Show answer
What are zombie and orphan processes?
Show answer
What does set -euo pipefail do in a bash script?
Show answer
How do you find files larger than 100 MB and older than 7 days under /var/log?
Show answer
Write a bash script that checks whether a service is running and restarts it if not.
Show answer
How do you count unique client IP addresses in an nginx access log?
Show answer
Write a script that alerts when any disk partition is above 80 percent used.
Show answer
A production server is very slow. How do you troubleshoot high CPU usage?
Show answer
You suddenly cannot SSH into a Linux server. What do you check?
Show answer
Tell me about a time you automated a repetitive manual task.
Show answer
Explain the Linux boot process briefly.
Show answer
df shows the disk is 100 percent full but du does not find large files. What is happening?
Show answer
The kernel OOM killer keeps killing your application. How do you handle it?
Show answer
An application logs 'Too many open files'. How do you fix it?
Show answer
What is Git and how is it different from GitHub?
Show answer
What is the difference between git fetch and git pull?
Show answer
What is git stash and when do you use it?
Show answer
What does git cherry-pick do?
Show answer
What is .gitignore and how do you stop tracking a file that is already committed?
Show answer
How do you undo the last commit but keep the changes?
Show answer
How do you create a new branch, push it and set the upstream?
Show answer
How do you view the commit history in a compact graph form?
Show answer
How do you create a release tag and push it?
Show answer
How do you make your commits and pull requests easy for teammates to review?
Show answer
What is the difference between git merge and git rebase?
Show answer
What is a detached HEAD state in Git?
Show answer
Explain git reset --soft, --mixed and --hard.
Show answer
What is the difference between git revert and git reset?
Show answer
What are Git hooks and how are they used in DevOps?
Show answer
How do you resolve a merge conflict?
Show answer
You deleted a local branch that had unmerged commits. How do you recover it?
Show answer
You pushed a broken commit to the shared main branch and the build is failing. What do you do?
Show answer
How do you squash your last three commits into one?
Show answer
Tell me about a time you disagreed with a code review comment.
Show answer
Compare GitFlow and trunk-based development.
Show answer
A developer accidentally pushed an AWS access key to a public repository. What do you do?
Show answer
Your repository has become huge because of binary files and clones are very slow. How do you fix it?
Show answer
Two features are in main but only one must go to production this week. How do you manage this?
Show answer
How do you use git bisect to find the commit that introduced a bug?
Show answer
What is the difference between continuous integration, continuous delivery and continuous deployment?
Show answer
What are the typical stages of a CI/CD pipeline?
Show answer
What is an artefact repository and why is it used?
Show answer
What is a webhook and how does it trigger a build?
Show answer
The build works on your laptop but fails on the CI server. How do you debug it?
Show answer
Explain the Jenkins controller and agent architecture.
Show answer
What is the difference between declarative and scripted Jenkins pipelines?
Show answer
Compare blue-green, canary and rolling deployments.
Show answer
How do you manage secrets in a CI/CD pipeline?
Show answer
Builds fail randomly because of flaky tests. How do you handle it?
Show answer
A production deployment failed halfway. What do you do?
Show answer
You need one pipeline that deploys to dev, staging and production with approval before production. How do you design it?
Show answer
Write a declarative Jenkinsfile with build, test and deploy stages.
Show answer
Write a GitHub Actions workflow that runs tests on every pull request.
Show answer
How do you run a matrix build in GitHub Actions?
Show answer
How do you build and push a Docker image from a pipeline?
Show answer
How do you use stored credentials inside a Jenkins pipeline?
Show answer
How do you handle pressure when a release is blocked close to a deadline?
Show answer
What is DevSecOps and which security checks belong in a pipeline?
Show answer
What is GitOps?
Show answer
What are DORA metrics?
Show answer
Your CI pipeline takes 40 minutes. How would you speed it up?
Show answer
The Jenkins controller is slow and builds keep queueing. What do you do?
Show answer
How do you run stages in parallel in a Jenkins declarative pipeline?
Show answer
Tell me about a production deployment that went wrong and how you handled it.
Show answer
What is the difference between a container and a virtual machine?
Show answer
What is the difference between a Docker image and a container?
Show answer
What is the difference between COPY and ADD in a Dockerfile?
Show answer
What is Docker Compose?
Show answer
A container exits immediately after it starts. How do you debug it?
Show answer
Database data disappeared after the container was recreated. Why, and how do you fix it?
Show answer
Which Docker commands do you use to debug a running container?
Show answer
How do you keep yourself updated with new DevOps tools and practices?
Show answer
How do Docker image layers and build caching work?
Show answer
What is the difference between CMD and ENTRYPOINT?
Show answer
Explain Docker network types.
Show answer
What is the difference between volumes and bind mounts?
Show answer
What is a multi-stage Docker build and why use it?
Show answer
Your Docker image is 1.5 GB. How do you reduce its size?
Show answer
Two containers on the same host cannot talk to each other. What do you check?
Show answer
The host disk is filling up because of Docker. How do you clean up and prevent it?
Show answer
Write a production-ready Dockerfile for a Node.js application.
Show answer
Write a multi-stage Dockerfile for a Java Spring Boot application.
Show answer
Write a Docker Compose file for a web app with a PostgreSQL database.
Show answer
How do you limit CPU and memory for a container?
Show answer
How do you add a health check to a Docker image?
Show answer
Tell me about a time you introduced a new tool or practice to your team.
Show answer
How do containers work under the hood using namespaces and cgroups?
Show answer
What are the best practices for securing Docker images?
Show answer
Your container takes 10 seconds to stop and does not shut down gracefully. Why?
Show answer
What is Kubernetes and why do companies use it?
Show answer
What is the difference between a Pod, a ReplicaSet and a Deployment?
Show answer
What is the difference between a ConfigMap and a Secret?
Show answer
What is a DaemonSet and when is it used?
Show answer
A pod shows ImagePullBackOff. What do you check?
Show answer
Which kubectl commands do you use most for debugging?
Show answer
Explain the Kubernetes architecture.
Show answer
Explain the Kubernetes Service types ClusterIP, NodePort and LoadBalancer.
Show answer
What is the difference between an Ingress and a Service?
Show answer
Explain liveness, readiness and startup probes.
Show answer
When do you use a StatefulSet instead of a Deployment?
Show answer
How does the Horizontal Pod Autoscaler work?
Show answer
A pod is in CrashLoopBackOff. How do you troubleshoot it?
Show answer
A pod is stuck in Pending state. What could be the reasons?
Show answer
Pods are running but the service is not reachable. How do you debug it?
Show answer
Write a Deployment manifest with 3 replicas, resource limits and a readiness probe.
Show answer
How do you perform a rolling update and roll back a Deployment?
Show answer
What is Helm and what are its basic commands?
Show answer
How do you create a Secret and use it as an environment variable in a pod?
Show answer
Describe how you handled an on-call incident late at night.
Show answer
What are resource requests and limits, and what are QoS classes?
Show answer
How does RBAC work in Kubernetes?
Show answer
During rolling updates some user requests fail. How do you get true zero-downtime deployments?
Show answer
A worker node shows NotReady. What do you do?
Show answer
Tell me about a time you migrated an application to Kubernetes.
Show answer
What is Infrastructure as Code and what are its benefits?
Show answer
Explain the basic Terraform workflow.
Show answer
Explain Ansible architecture: inventory, modules and playbooks.
Show answer
How do you define variables and outputs in Terraform?
Show answer
Write an Ansible playbook to install and start nginx.
Show answer
How do you write an Ansible inventory and run ad-hoc commands?
Show answer
What is the difference between declarative and imperative IaC, and between Terraform and Ansible?
Show answer
What is the Terraform state file and why is it important?
Show answer
What is remote state and state locking in Terraform?
Show answer
What are Terraform modules?
Show answer
What is the difference between count and for_each in Terraform?
Show answer
What does idempotency mean in Ansible?
Show answer
What are Ansible roles?
Show answer
You need to bring existing manually created cloud resources under Terraform. How?
Show answer
An Ansible playbook run against 100 servers failed on 7 of them. What do you do?
Show answer
Write Terraform code to create an AWS EC2 instance.
Show answer
How do you configure an S3 remote backend with locking?
Show answer
What are Ansible handlers and how do you use them?
Show answer
Tell me about a mistake you made in infrastructure work and what you learned.
Show answer
What is configuration drift and how do you detect it with Terraform?
Show answer
Two engineers ran terraform apply at the same time. What could go wrong and how do you prevent it?
Show answer
Someone deleted a resource manually that Terraform manages, and the state is now out of sync. What do you do?
Show answer
How do you manage dev, staging and production environments with Terraform?
Show answer
How do you handle secrets in Terraform and Ansible?
Show answer
How would you convince a team that manages servers by hand to adopt Infrastructure as Code?
Show answer
What are AWS Regions, Availability Zones and edge locations?
Show answer
Explain IAM users, groups, roles and policies.
Show answer
What are the S3 storage classes and lifecycle policies?
Show answer
What is the AWS shared responsibility model?
Show answer
Which AWS CLI commands do you commonly use?
Show answer
Write an EC2 user data script that installs and starts a web server on boot.
Show answer
Tell me about a time you had to learn a new cloud service quickly.
Show answer
Explain the main components of an AWS VPC.
Show answer
What is the difference between a security group and a network ACL?
Show answer
How do an Application Load Balancer and an Auto Scaling group work together?
Show answer
When would you choose ECS, EKS or Lambda?
Show answer
An EC2 instance in a private subnet cannot download packages from the internet. Why?
Show answer
An application on EC2 needs to read files from S3. How do you give it access securely?
Show answer
Someone made an S3 bucket with customer files public. What do you do?
Show answer
The application cannot connect to an RDS database. What do you check?
Show answer
Write an IAM policy that gives read-only access to one S3 bucket.
Show answer
How do you assume an IAM role in another account using the AWS CLI?
Show answer
How do you create an EKS cluster with eksctl and connect kubectl to it?
Show answer
Tell me about a time you reduced cloud costs.
Show answer
How do you prioritise when several teams ask you for infrastructure work at the same time?
Show answer
How do you design a highly available web application on AWS?
Show answer
The monthly AWS bill suddenly doubled. How do you investigate and fix it?
Show answer
An e-commerce site expects 10 times normal traffic during a festive sale. How do you prepare?
Show answer
How would you plan disaster recovery for a complete AWS region failure?
Show answer
How do you work with developers who resist new DevOps processes?
Show answer
What is the difference between monitoring and observability?
Show answer
What is the ELK or EFK stack?
Show answer
What is Site Reliability Engineering, and what is toil?
Show answer
You get an alert that the company website is down. What are your first steps?
Show answer
How do you configure Prometheus to scrape a target?
Show answer
How much downtime does a 99.9 percent availability SLO allow?
Show answer
How do you quickly search logs for errors from the last hour on a server or in Kubernetes?
Show answer
How do you handle the stress of on-call duty?
Show answer
What are the Prometheus metric types?
Show answer
What are the four golden signals, and the RED and USE methods?
Show answer
The on-call team gets dozens of alerts every night and is burning out. How do you fix it?
Show answer
Write PromQL queries for request rate, error rate and p95 latency.
Show answer
Write a Prometheus alerting rule for a high error rate.
Show answer
Tell me about a blameless post-mortem you were part of.
Show answer
How do you communicate with stakeholders during an outage?
Show answer
Explain the Prometheus architecture.
Show answer
Explain SLI, SLO, SLA and error budget.
Show answer
What is distributed tracing and how does OpenTelemetry help?
Show answer
What makes a good alert, and how do you avoid alert fatigue?
Show answer
Users complain the app is slow, but your dashboards look normal. What do you do?
Show answer
You suspect a memory leak in a production service. How do you confirm and handle it?
Show answer
You are the incident commander for a major outage. What do you do?
Show answer
Logging costs are rising fast because of huge log volume. What do you do?
Show answer
Your service has used its entire error budget halfway through the quarter. What happens next?
Show answer
Tell me about a time you improved the reliability of a system.
Show answer
Frequently asked questions
What jobs can I get after learning DevOps?
Freshers usually start as junior DevOps engineers, build and release engineers, cloud support associates or Linux administrators. With two to five years of hands-on experience you can move into DevOps engineer, cloud engineer and site reliability engineer roles, and later platform engineer, DevSecOps or cloud architect positions. IT services companies, product companies, banks, fintechs and startups across Bengaluru, Hyderabad, Pune, Noida, Gurugram and Chennai hire for these roles regularly.
Who is eligible to learn DevOps?
Anyone with basic computer knowledge can start, but it suits B.Tech, BCA, MCA and B.Sc IT students, software developers, testers and system or network administrators best. You do not need to be an expert programmer, but you should be comfortable with logic and willing to learn scripting. Professionals from support or testing backgrounds often switch to DevOps successfully because they already understand how applications run in production.
How long does it take to learn DevOps?
A focused learner can cover the core stack of Linux, Git, CI/CD, Docker, Kubernetes, Terraform and AWS in about four months with two to three hours of daily practice. Becoming job ready also needs hands-on projects that you can explain in interviews. Real depth in areas like Kubernetes operations, reliability and large-scale cloud design comes over the first few years of working on production systems.
Do I need coding knowledge for DevOps?
You need practical scripting rather than heavy application development. Bash is essential for automation on Linux, and Python is widely used for tooling and cloud scripts. You will also write a lot of YAML for pipelines and Kubernetes and HCL for Terraform. Being able to read application code helps you debug builds and production issues. Senior SRE and platform roles often expect stronger Python or Go skills.
Which certifications help in getting a DevOps job?
Useful certifications include AWS Certified Solutions Architect Associate or AWS DevOps Engineer Professional, Microsoft Azure Administrator or Azure DevOps Engineer Expert, Certified Kubernetes Administrator (CKA) and Certified Kubernetes Application Developer (CKAD) from the Linux Foundation, and HashiCorp Terraform Associate. Certifications help your resume clear screening, but interviewers mostly test hands-on skills, so combine them with real projects on GitHub.
Is DevOps a good career in India in 2026?
Yes. Companies keep moving workloads to cloud and Kubernetes, and they need engineers who can automate delivery, control cloud costs and keep systems reliable. DevOps, SRE and platform engineering roles are among the better paid technical roles at every experience level. The field changes quickly, with new tools and AI-assisted operations, so engineers who keep learning and understand fundamentals deeply grow fastest.