INTERVIEW PREP
Interview questions
570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.
Showing 211–225 of 475 questions
211.What is the difference between a Deployment, a ReplicaSet and a Pod?BeginnerKubernetes
A Pod runs one or more containers. A ReplicaSet keeps a number of identical Pods running. A Deployment manages ReplicaSets to give rolling updates and rollbacks; you normally only create Deployments.
212.How does a Service find its Pods?BeginnerKubernetes
Through its label selector. The endpoints controller lists ready Pods whose labels match, and kube-proxy (or the CNI) routes the Service's virtual IP to them.
213.What are the main parts of a Kubernetes cluster?BeginnerKubernetes
The control plane runs the API server, etcd (the database), the scheduler and the controller manager. Each worker node runs kubelet, a container runtime and kube-proxy (or a CNI that replaces it). You talk to the API server with kubectl.
214.What is a namespace used for?BeginnerKubernetes
It groups resources inside one cluster, for example per team or environment, and is the unit for RBAC, resource quotas and network policies. It is not a hard security boundary on its own.
215.What is the difference between a ConfigMap and a Secret?BeginnerKubernetes
Both hold configuration for Pods. Secrets are meant for sensitive data and are base64-encoded, not encrypted by default; turn on encryption at rest and limit access with RBAC, or use an external secret manager.
216.What are the Service types?BeginnerKubernetes
ClusterIP (internal only, the default), NodePort (a port on every node), LoadBalancer (a cloud load balancer) and ExternalName (a DNS alias). Ingress or Gateway API sit on top to route HTTP by host and path.
217.A Pod is in CrashLoopBackOff. How do you debug it?MidKubernetes
kubectl describe pod for events and the last state, kubectl logs pod --previous for the crashed container's output, check probes, config and resources, and use kubectl debug for an ephemeral shell if the image has none.
218.What is the difference between liveness and readiness probes?MidKubernetes
Readiness decides whether a Pod receives traffic; failing removes it from Service endpoints. Liveness decides whether to restart the container. A too-strict liveness probe causes restart loops under load.
219.What do resource requests and limits do?MidKubernetes
Requests are what the scheduler reserves and decide which node a Pod fits on. Limits cap usage: exceeding the memory limit gets the container OOM-killed, exceeding CPU gets it throttled.
220.A Pod is stuck in Pending. What do you check?MidKubernetes
kubectl describe pod shows the events. Common causes: not enough CPU or memory for its requests, taints without tolerations, node selectors or affinity that match no node, or a PersistentVolumeClaim that can't be bound.
221.How does a rolling update work, and how do you roll back?MidKubernetes
The Deployment creates a new ReplicaSet and shifts Pods over gradually, respecting maxSurge and maxUnavailable and waiting for readiness. Roll back with kubectl rollout undo deployment/web, and watch progress with kubectl rollout status.
222.What is the difference between a StatefulSet and a Deployment?MidKubernetes
StatefulSet Pods have stable names (db-0, db-1), their own PersistentVolume each, and start and stop in order. Use it for databases and clustered systems; use Deployments for stateless apps.
223.How does the Horizontal Pod Autoscaler work?MidKubernetes
It checks metrics (usually CPU or memory from metrics-server, or custom metrics) and changes the replica count to keep the target, for example 70% CPU. It needs resource requests set, because utilization is measured against them.
224.What is a PodDisruptionBudget?MidKubernetes
It limits how many Pods of an app can be down at once during voluntary disruptions like node drains and upgrades, for example minAvailable: 2. It doesn't protect against crashes or node failures.
225.What are taints and tolerations?MidKubernetes
A taint on a node keeps Pods away unless they have a matching toleration. Use them to reserve nodes, for example GPU nodes or system nodes. Combine with node affinity to also attract the right Pods there.