Kubernetes Interview Guide: Architecture, Pods, Networking & Troubleshooting
From Control Plane Internals to Production-Grade Debugging: The Complete K8s Interview Playbook

What You Must Master to Clear This Track
- Understand the exact hand-off between kube-apiserver, etcd, kube-scheduler, and kubelet before a Pod ever reaches Running state.
- Be able to explain Deployments, ReplicaSets, and scheduling constraints (affinity, taints/tolerations) as a reconciliation loop, not a one-shot command.
- Master the Service/Ingress/CNI/DNS request path end-to-end, including how kube-proxy and CoreDNS actually route traffic.
- Know how PV/PVC/StorageClass, ConfigMaps, and Secrets interact, and the real difference between HPA, VPA, and Cluster Autoscaler.
- Practice diagnosing CrashLoopBackOff, OOMKilled, and Pending pods live using kubectl describe, logs, and events — this is what senior interviews actually test.
Step-by-Step Study Plan
Follow this sequential roadmap designed to take you from core foundations to advanced architecture and mock interviews.
Cluster Anatomy: Control Plane, etcd & Node Components
kube-apiserver, etcd, kube-scheduler, kube-controller-manager, kubelet, kube-proxy, and the container runtime interface (CRI/containerd).
- •Explain the full lifecycle of `kubectl apply` from API request to etcd write to scheduled Pod.
- •Describe etcd's role as the cluster's single source of truth and why it uses the Raft consensus protocol.
- •Set up a local cluster (kind/minikube) and trace component logs for the API server, scheduler, and kubelet.
- •Run `kubectl get componentstatuses` and `kubectl -n kube-system get pods` to map every control plane component to a running process.
- •Read admission controller chains (MutatingAdmissionWebhook, ValidatingAdmissionWebhook) end-to-end at least once.
Pods, Deployments, Services, Ingress & CNI
ReplicaSet reconciliation, rolling updates, affinity/taints, ClusterIP/NodePort/LoadBalancer Services, Ingress controllers, CNI plugins, and CoreDNS.
- •Write Deployment manifests with resource requests/limits, readiness/liveness probes, and rolling update strategies.
- •Deploy an Ingress controller (NGINX/Traefik) and route two Services by host and path rules.
- •Explain how a Pod gets its IP address via CNI and how kube-proxy programs iptables/IPVS rules for Service VIPs.
- •Practice writing NetworkPolicies that default-deny ingress traffic and then selectively allow it.
- •Trace a request from an external client through Ingress -> Service -> Pod using `kubectl get endpoints` at each hop.
Stateful Workloads, Scaling Policies & Live Incident Response
PV/PVC/StorageClass provisioning, ConfigMaps/Secrets, HPA/VPA/Cluster Autoscaler, and diagnosing CrashLoopBackOff, OOMKilled, and Pending pods under pressure.
- •Deploy a StatefulSet backed by a dynamically provisioned PVC and simulate a Pod reschedule.
- •Configure an HPA driven by custom Prometheus metrics, not just CPU utilization.
- •Simulate and resolve CrashLoopBackOff, OOMKilled, and unschedulable Pending pods in a sandbox cluster.
- •Memorize the `kubectl describe pod` / `kubectl logs --previous` / `kubectl get events --sort-by=.lastTimestamp` triage sequence.
- •Practice explaining root cause and fix out loud in under 3 minutes per scenario — this is the exact format of live debugging rounds.
1. Kubernetes Architecture: Control Plane, etcd & Node Components
Every Kubernetes interview starts here: interviewers want to see that you understand the cluster as a distributed reconciliation system, not a black box that runs `kubectl apply`.
The only component that talks to etcd directly. Validates and authenticates every request (AuthN -> AuthZ -> Admission Controllers), then persists the desired state as an object in etcd.
A distributed, strongly-consistent key-value store using the Raft consensus algorithm. It is the single source of truth for all cluster state; losing quorum (majority of etcd members) makes the cluster read-only or unavailable.
Watches for Pods with an empty `.spec.nodeName`, filters nodes via predicates (resource fit, taints, affinity), scores the remaining candidates via priority functions, and binds the Pod to the winning node.
kubelet is the node agent that talks to the container runtime (via CRI) to start/stop containers and reports Pod status back to the API server. kube-proxy programs iptables/IPVS rules on every node so Service traffic reaches healthy Pod endpoints.
The full reconciliation path a Deployment manifest takes across the control plane and worker node.
- If asked 'what happens when you run kubectl apply', always narrate it as: API server -> etcd write -> controller reconciliation -> scheduler bind -> kubelet execution -> status report. This single answer covers 80% of architecture questions.
- Mention that etcd should run with an odd number of members (3 or 5) for Raft quorum, and that a majority-down etcd cluster halts all cluster writes even if Pods keep running.
- Saying 'the master schedules the pod' without naming kube-scheduler specifically — interviewers probe for component-level precision.
- Forgetting that kube-scheduler only makes the binding decision; kubelet (not the scheduler) is what actually starts the container.
2. Pods, Deployments, ReplicaSets & the Scheduler
Interviewers use this section to test whether you understand Kubernetes as a set of layered, self-healing controllers rather than a static deployment tool.
A Pod is one or more tightly coupled containers sharing a network namespace (same IP, localhost) and optionally storage volumes. Multi-container Pods use sidecar or init-container patterns, not unrelated services.
A ReplicaSet continuously watches its label selector and reconciles the observed Pod count against `spec.replicas`, creating or deleting Pods as needed. Deployments manage ReplicaSets to enable versioned rollouts and rollbacks.
`maxSurge` and `maxUnavailable` control how many extra/missing Pods are tolerated during a rollout. A new ReplicaSet scales up while the old one scales down, gated by readiness probes passing.
nodeAffinity/podAffinity attract Pods toward nodes or co-located Pods; podAntiAffinity spreads replicas across failure domains. Taints repel Pods from a node unless the Pod carries a matching toleration.
apiVersion: apps/v1
kind: Deployment
metadata:
name: checkout-api
labels:
app: checkout-api
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: checkout-api
template:
metadata:
labels:
app: checkout-api
spec:
containers:
- name: checkout-api
image: registry.internal/checkout-api:1.4.2
ports:
- containerPort: 8080
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
readinessProbe:
httpGet:
path: /healthz/ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz/live
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: checkout-api
topologyKey: kubernetes.io/hostname
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: checkout-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: checkout-api
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 65- Always mention QoS classes: Guaranteed (requests == limits for CPU and memory), Burstable (requests set but not equal to limits), and BestEffort (no requests/limits set) — this is the exact order the kubelet evicts Pods under node memory pressure.
- If asked about init containers, give a concrete example: waiting for a database migration Job to complete before the main application container starts.
- Confusing Deployment and ReplicaSet ownership — a Deployment never directly manages Pods, only ReplicaSets.
- Forgetting that without a readiness probe, a rolling update can route live traffic to a Pod that hasn't finished booting.
3. Services, Ingress & Cluster Networking (CNI & DNS)
Networking is where most candidates lose points — interviewers expect you to trace an actual packet, not just recite Service type names.
ClusterIP (default, internal-only virtual IP), NodePort (exposes a static port on every node), LoadBalancer (provisions a cloud LB pointing at NodePort), and ExternalName (DNS CNAME to an external service).
A Service load-balances at L4 (TCP/UDP) using a single VIP. An Ingress is an L7 HTTP(S) router: one Ingress Controller (NGINX, Traefik, ALB) can host-and-path-route many Services behind a single external IP, plus handle TLS termination.
The Container Network Interface plugin (Calico, Cilium, Flannel) assigns each Pod a unique cluster-wide routable IP, satisfying Kubernetes' flat-network model where every Pod can reach every other Pod without NAT.
CoreDNS runs as cluster Pods and resolves Service names like `checkout-api.default.svc.cluster.local` to the Service's ClusterIP, letting workloads discover each other by name instead of hardcoded IPs.
How an external HTTP request reaches a specific Pod through Ingress, kube-proxy, and the CNI network.
- When asked 'how does a Service find its Pods', answer with EndpointSlice objects explicitly — Services never talk to Pods directly, they select Pods via labels into an EndpointSlice that kube-proxy consumes.
- Know that NetworkPolicies are additive and namespace-scoped by default: with zero policies all traffic is allowed; the moment one policy selects a Pod, only explicitly allowed traffic passes.
- Mixing up Service `selector` label mismatches with the Deployment's Pod template labels — this is the single most common reason a Service has zero endpoints in real production incidents.
- Assuming Ingress load-balances at L4 like a Service — Ingress is fundamentally an HTTP/HTTPS (L7) construct.
4. Storage, ConfigMaps/Secrets, Autoscaling & Production Troubleshooting
This is the section senior and SRE-track interviews weight most heavily: can you reason about stateful storage, pick the right autoscaler, and debug a broken cluster under time pressure?
A PersistentVolume (PV) is a cluster storage resource; a PersistentVolumeClaim (PVC) is a namespaced request for storage by size/access mode. A StorageClass enables dynamic provisioning, so a PVC automatically triggers PV creation from the cloud provider's disk backend.
ConfigMaps hold non-sensitive configuration; Secrets hold sensitive data, base64-encoded (not encrypted) by default at rest unless you enable etcd encryption-at-rest or an external secret store (Vault, AWS Secrets Manager) via a CSI driver.
HPA scales Pod replica count based on metrics (CPU, memory, or custom/external). VPA adjusts a Pod's resource requests/limits over time. Cluster Autoscaler adds/removes worker nodes when Pods are unschedulable due to insufficient node capacity.
CrashLoopBackOff (app exits repeatedly, check logs --previous), OOMKilled (exit code 137, container exceeded memory limit), and Pending (unschedulable — insufficient resources, no matching node, or unbound PVC).
- For any 'debug this' scenario, always start the same way out loud: `kubectl describe pod <name>` for events, then `kubectl logs <name> --previous` if it restarted, then `kubectl get events --sort-by=.lastTimestamp` for cluster-wide context.
- If a Pod is Pending, immediately check `kubectl describe pod` events for 'Insufficient cpu/memory', 'node(s) had taint', or 'pod has unbound immediate PersistentVolumeClaims' — each maps to a different fix.
- Treating Secrets as encrypted by default — base64 is encoding, not encryption; without etcd encryption-at-rest, anyone with etcd access can read Secret values in plaintext.
- Enabling HPA and VPA on the same metric (CPU) for the same workload simultaneously, causing the two autoscalers to fight each other.
- Setting a memory limit without a matching request, which pushes the Pod into a burstable QoS class that gets evicted first under node pressure.
Stabilizing a Checkout Service Through a Flash-Sale Traffic Spike
A mid-size e-commerce platform's checkout-api ran on a 3-replica Deployment with no autoscaling configured. During a flash sale, traffic tripled within minutes, and the on-call SRE team started seeing a mix of 502s from the Ingress and Pods cycling through OOMKilled and CrashLoopBackOff.
- 1Ran `kubectl describe pod` and `kubectl get events --sort-by=.lastTimestamp` and found containers were hitting their memory limit (exit code 137) under the higher request volume, while other Pods were Pending due to insufficient node capacity.
- 2Right-sized the Deployment's resource requests/limits based on real memory usage from the metrics pipeline, moving the workload from Burstable to Guaranteed QoS to reduce eviction risk.
- 3Added an HPA targeting 65% CPU utilization with minReplicas: 3 and maxReplicas: 20, and enabled Cluster Autoscaler on the node group so new nodes could join automatically when Pods became unschedulable.
- 4Added a readiness probe hitting a real dependency-aware health endpoint so new Pods spun up by the HPA weren't added to the Service's Endpoints until they could actually serve traffic.
- 5Added a podAntiAffinity rule to spread replicas across nodes so a single node failure during peak load wouldn't take out multiple replicas at once.
- 6Load-tested the new configuration against a simulated 4x traffic spike in staging before the next scheduled sale event.
Top Must-Know Interview Questions & Model Answers
Q1: What is the role of etcd in a Kubernetes cluster, and what happens if it loses quorum?
- •kube-apiserver is the only component that reads/writes etcd directly — no other component talks to etcd.
- •etcd requires a quorum (majority) of its members to be healthy to commit writes via Raft; a 3-node cluster tolerates 1 failure, a 5-node cluster tolerates 2.
- •If quorum is lost, existing Pods keep running (kubelet caches state locally) but no new scheduling, scaling, or config changes can be persisted.
Q2: Walk through exactly what happens between running `kubectl apply -f deployment.yaml` and a container reaching Running state.
- •kube-apiserver validates the request through AuthN -> AuthZ -> Admission Controllers, then writes the object to etcd.
- •The Deployment controller creates a ReplicaSet, which creates Pod objects in Pending phase.
- •kube-scheduler filters and scores nodes, then binds the Pod; kubelet on that node pulls the image and starts the container, reporting status back to the API server.
Q3: What does kube-scheduler actually do, and how does it choose a node for a Pod?
- •Filtering (predicates) eliminates nodes that cannot run the Pod at all, e.g. insufficient CPU/memory, port conflicts, or an untolerated taint.
- •Scoring (priorities) ranks remaining nodes by criteria like resource balance, node affinity preference weight, and Pod spread across topology domains.
- •The scheduler only writes the binding decision — kubelet on the chosen node is what actually starts the container.
Q4: What is kube-controller-manager and how do reconciliation loops work?
- •Each controller uses a watch-based informer to get near-real-time updates on relevant objects rather than polling.
- •A reconciliation loop is idempotent: running it repeatedly against the same state produces the same result, which is what makes self-healing possible.
- •Example: if you manually delete a Pod managed by a ReplicaSet, the ReplicaSet controller notices the replica count mismatch and creates a replacement within seconds.
Q5: Explain kubelet's responsibilities and how it interacts with the container runtime.
- •kubelet watches the API server for Pods assigned to its node, then instructs the CRI-compliant runtime (containerd, CRI-O) to pull images and start/stop containers.
- •It runs liveness/readiness/startup probes and restarts or reports containers based on probe results and restartPolicy.
- •It reports node and Pod status (conditions, resource usage) back to the API server on a periodic heartbeat.
Q6: What is kube-proxy, and what is the difference between its iptables and IPVS modes?
- •iptables mode scans through a linear chain of rules per Service, which degrades in performance as the number of Services grows into the thousands.
- •IPVS mode uses in-kernel hash tables for constant-time lookups and supports more load-balancing algorithms (round-robin, least connection, source hashing).
- •Both modes ultimately rewrite the packet destination from the Service VIP to a live Pod IP drawn from the EndpointSlice.
Q7: How does a CNI plugin assign an IP address to a Pod?
- •CNI plugins like Calico (BGP routing) or Cilium (eBPF) each implement IP allocation and routing differently, but all must guarantee every Pod can reach every other Pod IP directly.
- •Overlay networks (VXLAN) encapsulate Pod traffic between nodes; underlay/BGP-based networks route Pod IPs natively without encapsulation overhead.
- •The CNI plugin also typically enforces NetworkPolicy rules if the plugin supports them (not all CNIs implement NetworkPolicy).
Q8: What is the difference between a Pod, a ReplicaSet, and a Deployment?
- •You almost never create a bare Pod or ReplicaSet directly in production — Deployments give you rollout history and `kubectl rollout undo`.
- •A Deployment update creates a new ReplicaSet and gradually shifts replica counts between old and new according to the rolling update strategy.
- •StatefulSets and DaemonSets are siblings of Deployment for different workload shapes: ordered/stable identity and one-per-node, respectively.
Q9: How do maxSurge and maxUnavailable control a rolling update?
- •Setting maxUnavailable: 0 and maxSurge: 1 gives a strictly additive rollout with zero downtime, at the cost of temporarily using extra capacity.
- •Setting maxSurge: 0 and maxUnavailable: 1 does an in-place style rollout that never exceeds the original replica count but briefly reduces capacity.
- •Readiness probes gate the rollout — a new Pod is not counted as 'available' until it passes readiness, so a broken image will pause the rollout rather than take down the whole service.
Q10: What are init containers and when would you use one?
- •If any init container fails, kubelet restarts the Pod's init container sequence according to restartPolicy — the main containers never start until all init containers succeed.
- •Common use cases: waiting for a database to become reachable, cloning a config repo into a shared volume, or running schema migrations.
- •Unlike sidecar containers, init containers do not run concurrently with the main application container.
Q11: Explain node affinity, pod affinity/anti-affinity, and taints/tolerations, and when you'd use each.
- •requiredDuringSchedulingIgnoredDuringExecution is a hard constraint checked only at scheduling time; preferred... is a soft, best-effort constraint.
- •podAntiAffinity with topologyKey: kubernetes.io/hostname is the standard way to spread Deployment replicas across different nodes for high availability.
- •Taints (e.g. `dedicated=gpu:NoSchedule`) reserve nodes for specific workloads; only Pods with a matching toleration can be scheduled there — this is how GPU or spot-instance node pools are isolated.
Q12: What are Kubernetes QoS classes and how do they affect eviction order?
- •QoS class is computed automatically from the Pod spec; you cannot set it directly.
- •Under memory pressure, kubelet ranks Pods for eviction by QoS class first, then by how far usage exceeds requests within the same class.
- •Setting only a memory limit without a request is a common mistake that lands a Pod in Burstable rather than the intended Guaranteed class.
Q13: What is the difference between ClusterIP, NodePort, LoadBalancer, and ExternalName Service types?
- •ClusterIP is the default and the building block every other Service type is layered on top of.
- •NodePort allocates a port (30000-32767 by default) on every node's IP, useful for on-prem clusters without a cloud load balancer integration.
- •ExternalName does no proxying at all — it's a pure DNS CNAME response, so it has no ClusterIP and no kube-proxy involvement.
Q14: How does Ingress differ from a Service of type LoadBalancer?
- •Exposing 20 microservices via LoadBalancer Services means 20 cloud load balancers and 20 external IPs; a single Ingress Controller can front all 20 behind one IP.
- •Ingress resources are just routing rules; you still need an Ingress Controller (NGINX, Traefik, cloud ALB controller) actually running to implement them.
- •TLS termination, URL rewriting, and canary traffic splitting are commonly handled at the Ingress layer rather than duplicated per Service.
Q15: How does DNS resolution work for a Service inside a Kubernetes cluster?
- •Every Pod's `/etc/resolv.conf` is configured by kubelet to point at the CoreDNS ClusterIP and to search the Pod's namespace domain by default.
- •For headless Services (ClusterIP: None), CoreDNS instead returns the individual Pod IPs directly, which is essential for StatefulSet peer discovery.
- •DNS caching misconfiguration (e.g. NodeLocal DNSCache not deployed) is a common source of latency spikes and CoreDNS overload at scale.
Q16: What is a headless Service and when would you use one?
- •StatefulSets pair with a headless Service so each replica gets a stable DNS name like `pod-0.svc-name.namespace.svc.cluster.local`.
- •This is essential for stateful systems like Kafka, Cassandra, or Elasticsearch where peers must know and connect to each other by identity, not just any replica.
- •Client-side load balancing libraries can also use headless Service DNS to get the full pod list and implement custom balancing logic themselves.
Q17: How do NetworkPolicies work, and what does 'default deny' mean in practice?
- •A common pattern is a 'default deny all ingress' policy per namespace (empty podSelector, no ingress rules) followed by targeted allow policies for specific traffic.
- •NetworkPolicies require a CNI plugin that implements enforcement (Calico, Cilium) — Flannel alone does not enforce them.
- •Policies can select by namespace, Pod label, and IP block (CIDR), enabling patterns like 'allow only the frontend namespace to call this backend Service'.
Q18: Explain the difference between PersistentVolume, PersistentVolumeClaim, and StorageClass.
- •Without a StorageClass, an administrator must pre-create PVs manually (static provisioning) for PVCs to bind to.
- •With dynamic provisioning, a PVC referencing a StorageClass automatically triggers creation of a matching PV from the underlying cloud disk API (EBS, PD, Azure Disk).
- •Access modes (ReadWriteOnce, ReadOnlyMany, ReadWriteMany) constrain how many nodes can mount the volume simultaneously and must match what the underlying storage backend supports.
Q19: What happens to a StatefulSet Pod's storage when the Pod is rescheduled to a different node?
- •StatefulSet Pods have stable, ordinal identities (`pod-0`, `pod-1`, ...) and each ordinal is bound to its own PVC for the lifetime of the StatefulSet.
- •On reschedule, the PV must be reattachable to the new node — for network-attached storage (EBS, PD) this typically works automatically via the CSI driver's attach/detach controller.
- •Deleting a StatefulSet does not delete its PVCs by default, which protects against accidental data loss but requires manual cleanup.
Q20: How are Secrets different from ConfigMaps, and are Secrets actually encrypted?
- •Base64 is a reversible encoding, not encryption — anyone with etcd read access or RBAC permission to `get secrets` can trivially decode the value.
- •Enabling an EncryptionConfiguration on the API server encrypts Secret data at rest in etcd using a provider like AES-CBC or KMS-backed envelope encryption.
- •Production-grade setups often use a CSI Secrets Store driver to pull Secrets from Vault or AWS/GCP/Azure secret managers instead of storing sensitive values in Kubernetes objects at all.
Q21: What is the difference between static and dynamic provisioning of storage?
- •Static provisioning is common for on-prem clusters using pre-existing NFS shares or SAN volumes that can't be created programmatically.
- •Dynamic provisioning is the default expectation in cloud environments, where the CSI driver calls the cloud provider's API to create a new disk on demand.
- •A cluster can mix both: a default StorageClass for dynamic provisioning, plus manually created PVs for special hardware-backed volumes.
Q22: What is the difference between HPA, VPA, and Cluster Autoscaler?
- •HPA operates at the workload layer (Deployment/StatefulSet replica count) using CPU, memory, or custom/external metrics from a metrics pipeline like Prometheus Adapter.
- •VPA operates at the container resource layer, and typically requires evicting and recreating a Pod to apply new resource values (unless using in-place resize, which is still maturing).
- •Cluster Autoscaler operates at the infrastructure layer, watching for Pending Pods due to insufficient node resources and requesting new nodes from the cloud provider's node group/ASG.
Q23: How does HPA calculate the desired replica count from a metric?
- •For CPU/memory (Resource metrics), values come from the metrics-server; for custom or external metrics, values come from a metrics adapter like Prometheus Adapter or KEDA.
- •A stabilization window (default 5 minutes for scale-down, 0 for scale-up in v2) prevents rapid oscillation from transient spikes.
- •HPA will not scale below minReplicas or above maxReplicas regardless of metric pressure, so those bounds must reflect real capacity planning.
Q24: Can HPA and VPA be safely used together on the same workload?
- •VPA in 'Recreate' mode evicts and restarts Pods to apply new resource values, which can conflict with HPA's replica count changes happening at the same time.
- •VPA also has an 'Off'/recommendation-only mode, which many teams use just to get sizing insights without VPA automatically restarting Pods.
- •KEDA is often chosen over VPA+HPA combinations because it can scale on external event-source metrics (queue depth, Kafka lag) cleanly alongside CPU-based HPA.
Q25: How does Cluster Autoscaler decide to scale down a node?
- •Pods with restrictive PodDisruptionBudgets, local storage, or without a controller (bare Pods) can block a node from being scaled down.
- •Cluster Autoscaler simulates whether evicted Pods can be rescheduled onto remaining nodes before it proceeds, to avoid causing Pending Pods.
- •Scale-up is triggered the moment any Pod is unschedulable due to resource shortage; scale-down is intentionally slower and more cautious to avoid churn.
Q26: A Pod is stuck in CrashLoopBackOff. Walk through how you'd debug it.
- •`kubectl logs <pod> --previous` shows the logs from the last crashed container instance, since the current instance may not have logged anything yet.
- •`kubectl describe pod <pod>` reveals the exact exit code (e.g. 1 for app error, 137 for OOMKilled) and the exponential backoff delay Kubernetes is applying between restarts.
- •Common root causes: missing environment variable/Secret causing immediate app crash, a failing liveness probe killing an otherwise-healthy but slow-starting container, or a bad container command/entrypoint.
Q27: What causes OOMKilled, and how do you fix it?
- •`kubectl describe pod` shows `Reason: OOMKilled` and `Exit Code: 137` under the container's last state when this happens.
- •This is a hard cgroup memory limit enforcement, unrelated to node-level memory pressure eviction (which is a separate kubelet mechanism using QoS class ordering).
- •Before blindly raising the limit, check whether it's a genuine leak (steadily growing RSS over time) versus simply an under-provisioned limit for a legitimately memory-hungry workload.
Q28: A Pod has been Pending for 10 minutes. What are the possible causes and how do you diagnose it?
- •'Insufficient cpu/memory' means no node currently has enough allocatable capacity; the fix is either scaling nodes (Cluster Autoscaler) or reducing requests.
- •'node(s) had taint {...} that the pod didn't tolerate' means the Pod's tolerations/affinity don't match any available node — check node labels and taints.
- •'pod has unbound immediate PersistentVolumeClaims' means the PVC hasn't been bound to a PV yet, often due to a StorageClass provisioning failure or zone mismatch between the Pod and available volumes.
Q29: What is the difference between ImagePullBackOff and ErrImagePull?
- •Common causes: a typo in the image name/tag, a private registry requiring an imagePullSecret that wasn't configured, or the image simply not existing at that tag.
- •`kubectl describe pod` will show the exact registry error message (e.g. 401 Unauthorized, manifest not found) under Events.
- •Fixing usually means correcting the image reference or creating/attaching the correct `imagePullSecrets` to the Pod's ServiceAccount.
Q30: What is the difference between a liveness probe and a readiness probe, and what happens if you misconfigure them?
- •A liveness probe with too short a timeout on a legitimately slow-starting app causes kubelet to repeatedly kill and restart a healthy container, sometimes manifesting as CrashLoopBackOff.
- •A missing or too-lenient readiness probe means a Pod is added to Service endpoints before it can actually handle requests, causing user-facing errors during deploys or scale-ups.
- •startupProbe (a third probe type) is designed specifically to give slow-starting containers more grace time before liveness checks even begin.
Q31: How would you debug a Service that has no traffic reaching any of its Pods?
- •An empty EndpointSlice/Endpoints object is the single most common root cause and is purely a label-selector mismatch between the Service and the Pod template.
- •If endpoints exist but traffic still fails, check NetworkPolicies for an unintended default-deny blocking the path, or a CNI/kube-proxy misconfiguration.
- •Port mismatches (Service `targetPort` not matching the container's actual listening port) are another frequent, easy-to-miss cause.
Mistakes That Sink Otherwise Strong Candidates
Why it happens: Teams move fast in early stages and treat requests/limits as optional boilerplate rather than the mechanism that drives scheduling and QoS.
The fix: Always set both CPU/memory requests and limits; use Guaranteed QoS (requests == limits) for latency-sensitive or critical workloads.
Why it happens: It feels convenient during early development and nobody circles back to pin versions before shipping.
The fix: Pin every deployment to an immutable image tag or digest, and roll forward through new tags via CI/CD rather than mutating `:latest`.
Why it happens: The default probe timing is copied from a template without accounting for the app's real startup time.
The fix: Use a startupProbe with generous initial delay for slow-booting apps, and keep liveness probes lenient enough to avoid killing healthy-but-busy containers.
Why it happens: Secrets and ConfigMaps look interchangeable at the YAML level, so teams default to whichever is simpler to wire up.
The fix: Use Secrets with etcd encryption-at-rest enabled, or better, an external secrets manager via a CSI driver, and never commit raw credential values to version control.
Why it happens: PDBs are easy to forget because their absence has no effect until a node drain or cluster upgrade actually happens.
The fix: Set a PodDisruptionBudget (e.g. minAvailable: 2) on every critical Deployment so voluntary evictions during upgrades or scale-downs can't take the whole workload offline at once.
Why it happens: Labels get refactored on the Deployment template during a later change without updating the corresponding Service selector.
The fix: Keep Service selectors and Pod template labels under the same reviewed change, and verify with `kubectl get endpoints` after every label change.
Why it happens: Teams adopt VPA for 'automatic right-sizing' without realizing HPA is already reacting to the same CPU signal.
The fix: Split responsibilities: use VPA (or its recommender-only mode) for baseline resource sizing, and HPA for reactive replica scaling on a distinct or complementary metric.
Why it happens: Backup automation is deprioritized until an actual outage forces the issue.
The fix: Automate periodic etcd snapshots and regularly test restoring them in a non-production cluster as part of standard disaster-recovery drills.
Quick-Reference Cheat Sheet
Recommended Practice Quizzes on QuizCluster
Test your retention and prepare for timed live coding and MCQ technical screening rounds:
Docker & Kubernetes
Drill container internals, Pod scheduling, Services, Ingress, and storage/autoscaling scenarios.
High-Level System Design (HLD)
Practice designing scalable, resilient architectures that deploy on Kubernetes at production scale.
Frequently Asked Questions
How much Kubernetes knowledge is expected for a DevOps interview vs an SDE interview?
DevOps/SRE/Platform interviews expect deep architecture and troubleshooting fluency (etcd internals, scheduler behavior, live debugging). SDE interviews typically only expect you to know Deployments, Services, and basic YAML — enough to deploy and reason about a containerized application.
Should I get hands-on practice with a real cluster before interviewing?
Yes. Run a local cluster with kind or minikube and deliberately break things — delete a Pod's Service selector label, set an unreachable memory limit, misconfigure a probe — then practice diagnosing each with kubectl. This hands-on debugging fluency is exactly what live technical rounds test.
Is CKA/CKAD certification worth it for interview prep?
The certification itself is less important than the study process — CKA/CKAD prep forces you through the same command-line troubleshooting muscle memory that interviewers probe for, so it's a strong study framework even if the certificate isn't explicitly required.
Do I need to know Helm or GitOps tools like ArgoCD for a Kubernetes interview?
For most roles, a working conceptual understanding is enough: Helm templates and packages manifests, ArgoCD/Flux continuously reconcile cluster state from a Git repo. Deep hands-on expertise is usually only expected for platform engineering or GitOps-focused roles.