DevOps Fundamentals
1. What is DevOps?
A culture and set of practices where development and operations share responsibility for building, releasing and running software. It uses automation (CI/CD, IaC), small frequent changes, monitoring and fast feedback to deliver faster and more reliably.
2. What are the DORA metrics?
Deployment frequency, lead time for changes, change failure rate and time to restore service. They measure delivery speed and stability together.
3. DevOps vs SRE vs Platform Engineering?
DevOps is a culture and practice set. SRE applies software engineering to operations with SLOs, error budgets and toil reduction. Platform engineering builds internal self-service platforms and golden paths so product teams can deliver without deep infrastructure knowledge.
4. What is Infrastructure as Code and why use it?
Defining infrastructure in version-controlled files. Benefits: repeatability, reviewable changes, fast recovery, consistent environments, documentation and drift detection.
5. What is a blameless postmortem?
A review after an incident focused on how the system and process allowed the failure, not on who made the mistake. It produces timeline, causes and tracked action items.
Linux and Networking
6. A server is slow. How do you investigate?
uptimeandtoporhtop: load average, CPU, memoryfree -h,vmstat: swapping and memory pressuredf -handdf -i: disk space and inodesiostat,iotop: disk I/O waitss -tulpnandnetstat: network connections and portsjournalctl -xe,/var/log: errors and OOM kills (dmesg | grep -i kill)- Check recent changes, deployments and cron jobs
7. What is the difference between a process and a thread, and what is a zombie process?
A process has its own memory space. Threads share the memory of their process. A zombie is a finished child process whose exit status was not collected by its parent. It uses no CPU but holds a process table entry.
8. Explain file permissions rwxr-xr--.
Owner can read, write and execute (7), group can read and execute (5), others can read only (4). Numeric mode 754. Change with chmod, change owner with chown.
9. Hard link vs soft link?
A hard link is another name for the same inode and survives deletion of the original name. A soft (symbolic) link is a separate file that points to a path and breaks if the target is removed.
10. What happens when you type a URL in a browser?
DNS resolves the name to an IP, the browser opens a TCP connection, a TLS handshake secures it, the HTTP request goes through possible CDN, load balancer and reverse proxy to the application, which may query a database, and the response returns and is rendered.
11. A service works by IP but not by name. Why?
DNS problem: wrong record, stale cache or TTL, resolver misconfiguration, split-horizon DNS or missing search domain. Check with dig, nslookup and /etc/resolv.conf.
12. What is the difference between TCP and UDP?
TCP is connection-oriented, reliable and ordered (HTTP, SSH, databases). UDP is connectionless and fast with no delivery guarantee (DNS queries, streaming, some metrics).
Git
13. Merge vs rebase?
Merge combines histories with a merge commit and preserves the true history. Rebase replays commits on top of another base for a linear history but rewrites commit ids. Never rebase commits that others have already pulled.
14. How do you undo a pushed commit?
git revert <sha> creates a new commit that undoes it. This is safe for shared branches. reset --hard plus force push rewrites shared history and should be avoided.
15. How do you resolve a merge conflict?
Open the conflicted files, choose or combine the correct content, remove the markers, git add the file and complete with git commit (or git rebase --continue). Use --abort to go back.
16. What is git cherry-pick, stash and reflog?
Cherry-pick applies one commit to another branch. Stash saves uncommitted work temporarily. Reflog records where HEAD has been and can recover lost commits.
17. Which branching strategy do you prefer?
Trunk-based development with short-lived branches, feature flags and strong CI fits fast delivery. Gitflow suits versioned products with scheduled releases. Choose according to release model and team maturity.
18. A secret was committed to Git. What do you do?
Revoke and rotate the secret immediately, check logs for misuse, remove it from history (git filter-repo), and add secret scanning (pre-commit and CI) to prevent a repeat.
Docker and Containers
19. Image vs container? Container vs VM?
An image is a read-only template, a container is a running instance. Containers share the host kernel and are lightweight, while VMs include a full guest OS and have stronger isolation.
20. How do you reduce Docker image size?
- Multi-stage builds, so compilers do not ship to production
- Small bases (slim, alpine, distroless)
- Combine and clean package install steps
.dockerignoreand no dev dependencies
21. CMD vs ENTRYPOINT? COPY vs ADD?
ENTRYPOINT is the fixed executable, CMD supplies default arguments or the default command and can be overridden. COPY copies files. ADD also extracts archives and fetches URLs, so prefer COPY for clarity.
22. How does Docker layer caching work, and how do you use it?
Each instruction creates a cached layer. A change invalidates that layer and all later ones. Order instructions from least to most frequently changing (copy dependency files, install, then copy source).
23. How do containers communicate and keep data?
On a user-defined bridge network containers resolve each other by name. Data that must survive container removal goes in volumes (or bind mounts for development).
24. A container keeps restarting. How do you debug?
docker ps -a for exit code, docker logs, docker inspect for env and mounts, run with --entrypoint sh to explore, check memory limits (exit 137 means killed, often OOM), and health checks.
25. How do you secure containers?
Non-root user, minimal images, scan and sign images, drop capabilities, read-only filesystem, resource limits, no secrets in images, no --privileged and no mounted Docker socket.
CI/CD
26. CI vs continuous delivery vs continuous deployment?
CI merges and tests every change automatically. Continuous delivery keeps every build releasable with a manual approval for production. Continuous deployment releases every passing change automatically.
27. Describe a pipeline you built.
Structure the answer: trigger, test and lint, security scans, build and tag one artifact (image with commit SHA), push to a registry, deploy to staging, automated checks, approval, production deployment with health check and rollback, then notifications and metrics.
28. What does build once, deploy many mean?
Create a single versioned artifact and promote the same artifact through environments with different configuration, so what you tested is exactly what you release.
29. Jenkins: declarative vs scripted pipelines? What are agents?
Declarative pipelines have a structured syntax (pipeline, stages, post) and are easier to read and validate. Scripted pipelines are full Groovy for complex logic. Agents are the machines or containers that execute the stages. Run builds on ephemeral agents, not on the controller.
30. How do you keep secrets safe in pipelines?
Use the platform secret store or a vault, mask values in logs, scope secrets to environments, prefer OIDC federation for short-lived cloud credentials, rotate regularly and never print them.
31. Deployment strategies?
| Strategy | One-line answer |
|---|---|
| Rolling | Replace instances gradually. No extra capacity, two versions coexist |
| Blue/green | Full new copy, switch traffic. Instant rollback, double capacity |
| Canary | Small percent of traffic first, check metrics, then expand |
| Feature flags | Deploy code off, release by configuration |
| Recreate | Stop then start. Simple but causes downtime |
32. How do you handle database migrations in CD?
Use backward compatible migrations with expand and contract, run migrations as a controlled pipeline step with a migration tool (Flyway, Liquibase), keep old and new code compatible during rollout and take backups before risky changes.
33. Your pipeline takes 40 minutes. How do you speed it up?
- Run independent jobs in parallel and split tests into shards
- Cache dependencies and Docker layers
- Run fast checks first and heavy tests only when needed (path filters)
- Use faster or larger runners and avoid rebuilding unchanged artifacts
- Remove flaky tests or quarantine them
Scenario Questions
34. Production is down after a release. What do you do?
- Acknowledge, declare an incident, assign roles
- Mitigate first: roll back or disable the feature flag
- Communicate status to stakeholders
- Verify recovery with metrics and logs
- Find the root cause, write a blameless postmortem and add prevention (tests, alerts, canary)
35. Design a CI/CD pipeline for a microservices app on Kubernetes.
One pipeline per service in its own repo (or path-filtered in a monorepo). Test, scan, build and sign an image tagged by SHA, push to a registry, update the image tag in a GitOps config repo, Argo CD syncs to staging, run automated tests, promote to production by pull request with canary rollout and automatic analysis, with dashboards and alerts per service.
36. How would you migrate an application from manual deployments to DevOps?
Put code and configuration in Git, add automated tests and CI, containerize, define infrastructure with IaC, add a deployment pipeline to a test environment first, add monitoring, then move production deployments gradually with rollback plans and training. Measure DORA metrics to show progress.
Conclusion
For fundamentals interviews connect each tool to a purpose and a trade-off: Linux troubleshooting method, Git recovery commands, Docker image optimization and security, CI/CD pipeline design and deployment strategies, and calm incident handling.

