DevOps Interview Questions and Sample Answers
This article provides concise answers to common DevOps interview questions, covering Linux boot processes, Kubernetes container execution, Git operations, Jenkins pipelines, DNS, networking, monitoring with Prometheus and Grafana, databases, SQL indexing, and collaboration and leadership scenarios.
Continuing from the previous article on DevOps interview questions, this piece offers answers to help you understand what foreign companies focus on for DevOps roles and how to approach these questions.
1. Explain how the Linux mechanism works, especially during system boot.
Linux boot flow: BIOS → load kernel → kernel initializes hardware and mounts the root filesystem → starts the init process (e.g., systemd) → loads services and applications. The init process manages system initialization tasks such as starting network services and daemons.
2. What happens when you run a container in Kubernetes? Explain its internal workings.
Kubernetes schedules the Pod to a node via the control plane (API Server). The Kubelet on the selected node invokes the container runtime (containerd or Docker) to start the container. The Pod’s network is configured by a CNI plugin, and persistent storage (e.g., PV) is mounted as a volume. Scheduling, networking, and storage are all managed uniformly by Kubernetes.
3. What is the difference between git merge and git rebase ? git merge combines the histories of two branches, preserving all commits. git rebase reapplies the current branch’s commits onto the target branch, rewriting history to produce a linear commit sequence.
4. Why and when would you use git cherry-pick ? git cherry-pick selects specific commits from one branch and applies them to another, useful when you need particular changes without merging the entire branch.
5. What are the main differences between Declarative and Scripted Jenkins pipelines?
Declarative pipelines have a simpler, structured syntax suitable for beginners and straightforward tasks. Scripted pipelines offer more flexibility and control, making them better for complex automation.
6. What is DNS and how does it work?
DNS (Domain Name System) translates domain names to IP addresses. When a user accesses a website, the browser queries DNS servers to resolve the domain. The process includes recursive and authoritative queries, with caching to speed up subsequent lookups.
7. Explain how routing works in a network environment.
Routing determines the path packets take from source to destination. Routers use routing tables to select the best path based on the destination IP. Dynamic routing protocols automatically adjust routes as the network topology changes.
8. How do you implement network policies in Kubernetes?
Kubernetes Network Policies define traffic rules that control communication between Pods or between Pods and external endpoints. Users create NetworkPolicy resources to specify which Pods are allowed to communicate on which ports.
9. How do Prometheus and Grafana interact? Where does Prometheus get its data?
Prometheus collects metric data and stores it in a time‑series database. Grafana queries Prometheus as a data source to visualize those metrics. Prometheus scrapes metrics from monitored targets (e.g., Kubernetes nodes, applications) using a pull model.
10. Which database did you use in your recent project and why?
Answer based on the specific project, mentioning reasons for choosing a relational database (e.g., PostgreSQL) or a NoSQL database (e.g., MongoDB) such as data structure, scalability, or performance.
11. What is an SQL index and how does it work?
An SQL index is a sorted data structure on one or more columns that speeds up queries. It typically uses a B‑tree or hash table to reduce the time complexity of lookups.
12. Share a challenge you faced when collaborating with non‑technical teams and how you resolved it.
A common example is a disagreement with a product team over priority. Resolution involves clear communication, explaining technical impact, and finding a balance between business needs and technical feasibility.
13. Do you consider yourself a communicator or a problem‑solver?
You can describe yourself as both, emphasizing the ability to identify issues through communication and solve them collaboratively.
14. Describe a situation where you took a leadership role.
Discuss organizing a team to complete a project, highlighting how you led, coordinated, and drove the team toward successful delivery.
15. What values do you think are important in teamwork?
Transparency, mutual respect, accountability, and trust are core values that enable efficient collaboration.
16. Why did you choose Docker in your recent project?
Docker provides a lightweight container solution that ensures consistent development environments, supports rapid deployment, testing, and scaling, and fits well with micro‑service architectures.
17. What are your hobbies outside of technical work?
Showcase a balanced lifestyle by mentioning activities such as fitness, reading, traveling, or contributing to open‑source projects, which demonstrate personal growth and creativity.
DevOps Engineer
DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
