Most DevOps interviews test four things: Linux and networking basics, CI/CD, containers and Kubernetes, and how you think when production breaks. This list covers the 30 questions that come up most often for freshers and engineers with up to three years of experience, with short answers you can explain in your own words.
Do not memorise the answers. Read each one, then try it on a real machine. Interviewers almost always ask a follow-up such as have you done this yourself? If you are still learning the basics, start with our DevOps roadmap for beginners.
DevOps basics
1. What is DevOps?
DevOps is a way of working where development and operations teams share responsibility for building, releasing and running software. It combines culture (shared ownership), practices (CI/CD, infrastructure as code, monitoring) and tools (Git, Jenkins, Docker, Kubernetes, Terraform). The goal is to release small changes often and safely.
2. How is DevOps different from Agile?
Agile improves how teams plan and build software in short iterations. DevOps extends that to how software is tested, deployed and operated. Agile ends at a working increment; DevOps makes sure that increment reaches users and keeps running.
3. What are the main stages of a DevOps lifecycle?
Plan, code, build, test, release, deploy, operate and monitor. Feedback from monitoring goes back into planning, which is why it is usually drawn as an infinity loop.
4. What is the difference between continuous delivery and continuous deployment?
| Continuous delivery | Continuous deployment |
|---|---|
| Every change is built, tested and ready to release. | Every change that passes the pipeline is released automatically. |
| A person approves the production release. | No manual approval step. |
| Common in banks and regulated companies. | Common in product companies with strong automated tests. |
Linux and networking questions
5. How do you check which process is using a port?
sudo ss -tulpn | grep 8080
# or
sudo lsof -i :8080
6. How do you find why a server is slow?
Check in this order: CPU and load with top or uptime, memory with free -h, disk space with df -h, disk I/O with iostat, and recent errors with journalctl -p err -n 50. Explaining a calm, step-by-step approach matters more than naming every tool.
7. What do the file permissions 755 and 644 mean?
Each digit is owner, group and others. 7 is read, write and execute; 5 is read and execute; 4 is read only. So 755 suits scripts and folders, and 644 suits normal files such as configuration.
8. What happens when you type a URL in the browser?
The browser resolves the domain through DNS, opens a TCP connection to the IP, performs a TLS handshake for HTTPS, sends an HTTP request, and the server (often behind a load balancer) returns a response that the browser renders. Interviewers use this to check your networking basics.
9. What is the difference between TCP and UDP?
TCP is connection-based and guarantees ordered delivery, so it is used for web traffic and databases. UDP has no handshake or delivery guarantee, so it is faster and used for DNS queries, video calls and streaming.
Git and CI/CD questions
10. What is the difference between git merge and git rebase?
Merge joins two branches and keeps both histories, adding a merge commit. Rebase replays your commits on top of another branch, giving a straight history. A safe rule: rebase your own local branch, but never rebase a branch others have already pulled.
11. How do you undo the last commit?
# keep the changes in your working folder
git reset --soft HEAD~1
# commit already pushed? create a new commit that reverses it
git revert HEAD
12. What is a CI/CD pipeline?
An automated sequence that runs on every change: checkout code, install dependencies, run tests, build an artifact or image, scan it, then deploy to test and production environments. Tools include Jenkins, GitHub Actions, GitLab CI and Azure DevOps.
13. Write a simple pipeline.
A GitHub Actions example that tests a Node.js app on every push:
name: ci
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
14. How do you store secrets in a pipeline?
Never in the repository. Use the CI tool’s secret store (GitHub secrets, Jenkins credentials) or a vault such as HashiCorp Vault or AWS Secrets Manager, and inject them as environment variables at run time.
Docker questions
15. What is the difference between an image and a container?
An image is a read-only template with your app and its dependencies. A container is a running instance of an image. One image can start many containers.
16. What is the difference between CMD and ENTRYPOINT?
ENTRYPOINT sets the main command that always runs. CMD sets default arguments that can be overridden when you run the container. They are often used together.
17. How do you make a Docker image smaller?
- Use a slim or alpine base image.
- Use multi-stage builds so build tools stay out of the final image.
- Combine related
RUNsteps and clean package caches. - Add a
.dockerignorefile.
FROM node:20 AS build
WORKDIR /app
COPY . .
RUN npm ci && npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
18. How do containers talk to each other?
Put them on the same user-defined Docker network and call each other by container or service name. In Docker Compose, every service in the file joins a shared network automatically.
Kubernetes questions
19. What is a Pod?
The smallest deployable unit in Kubernetes. It wraps one or more containers that share the same network IP and storage volumes.
20. Deployment vs StatefulSet vs DaemonSet?
| Object | Use it for |
|---|---|
| Deployment | Stateless apps such as APIs and web front ends. |
| StatefulSet | Databases and apps that need stable names and storage. |
| DaemonSet | One pod per node, such as log or monitoring agents. |
21. What are the Service types?
ClusterIP exposes the app inside the cluster only, NodePort opens a port on every node, and LoadBalancer asks the cloud provider for an external load balancer. An Ingress sits in front and routes HTTP traffic by host or path.
22. A pod is in CrashLoopBackOff. What do you do?
kubectl describe pod <pod-name>
kubectl logs <pod-name> --previous
Look for a wrong command, missing environment variable or secret, failing health check, or memory limit too low (OOMKilled).
23. How does a rolling update work?
Kubernetes creates new pods with the new version and removes old ones gradually, controlled by maxSurge and maxUnavailable. If something fails, kubectl rollout undo deployment/<name> goes back to the previous version.
Infrastructure as code and cloud
24. What is Terraform state?
A file that maps your Terraform code to the real resources it created. Teams keep it in a remote backend such as an S3 bucket with locking, so two people cannot change infrastructure at the same time.
25. Terraform vs Ansible?
Terraform provisions infrastructure (networks, servers, databases) and is declarative. Ansible configures what runs on servers (packages, files, services) and is mostly procedural. Many teams use both.
26. What is the difference between horizontal and vertical scaling?
Vertical scaling adds CPU or memory to one machine. Horizontal scaling adds more machines behind a load balancer. Horizontal scaling is preferred for cloud apps because it has no single machine limit.
Monitoring and scenario questions
27. What would you monitor for a web application?
Use the four golden signals: latency, traffic, errors and saturation. Typical tools are Prometheus and Grafana for metrics, the ELK stack or Loki for logs, and alerts routed to Slack or PagerDuty.
28. The website is down. Walk me through your steps.
- Confirm the problem and its scope (all users or some regions).
- Check recent deployments and roll back if one matches the time.
- Check load balancer health, then app logs, then the database.
- Communicate status to the team while you work.
- After recovery, write a blameless post-mortem with fixes.
29. What is blue-green deployment?
You run two identical environments. Blue serves users while you deploy to green. After testing green, you switch traffic to it. If something goes wrong, you switch back in seconds.
30. Tell me about a pipeline you built.
This is the most important question for freshers. Prepare one project you can explain end to end: the app, the repository, the pipeline stages, where the image is stored, how it is deployed and how you checked it worked. A small project you truly understand beats a long list of tools.
How to prepare in two weeks
| Days | Focus |
|---|---|
| 1 to 3 | Linux commands, permissions, processes, networking basics |
| 4 to 6 | Git workflows and one CI pipeline on GitHub Actions or Jenkins |
| 7 to 9 | Dockerfiles, Compose, image optimisation |
| 10 to 12 | Kubernetes objects, kubectl debugging, Helm basics |
| 13 to 14 | Terraform basics, mock interviews, explain your project aloud |
Frequently asked questions
Are DevOps interviews hard for freshers?
They are practical rather than hard. Freshers are expected to know Linux, Git, one CI tool and Docker well, and to show a working project. Kubernetes and Terraform depth is a bonus.
Do DevOps interviews include coding?
Usually only scripting: a Bash or Python script to parse logs, check disk usage or call an API. Practise small automation scripts rather than algorithm puzzles.
Which certification helps most?
AWS Certified Cloud Practitioner or Solutions Architect Associate, and the Certified Kubernetes Administrator (CKA), are the most recognised. A certificate helps you get shortlisted; projects help you clear the interview.
Keep learning with our DevOps tutorials, or compare cloud platforms in AWS vs Azure vs Google Cloud.