ReplicaSets Interview Questions
Why ReplicaSets Matter in Interviews
ReplicaSets are the mechanism that keeps your desired number of Pod replicas running at all times, and they sit at the heart of how Deployments work. While most teams interact with Deployments rather than ReplicaSets directly, interviewers ask about ReplicaSets to test whether you understand the layers of abstraction in Kubernetes and can troubleshoot issues that surface at the ReplicaSet level.
A common interview question is "What is the relationship between a Deployment and a ReplicaSet?" The expected answer goes beyond "Deployments manage ReplicaSets" — strong candidates explain that each Deployment rollout creates a new ReplicaSet, the old ReplicaSet is scaled down but retained for rollback, and the revision history limit controls how many old ReplicaSets are kept. This understanding is critical for debugging stuck rollouts where old and new ReplicaSets coexist.
Selector matching is another important area. Interviewers may ask what happens if you create a bare Pod with labels that match an existing ReplicaSet's selector — the answer is that the ReplicaSet adopts it and may immediately terminate it if the replica count is already satisfied. This behavior catches many candidates off guard and reveals whether they understand the reconciliation loop.
Scaling questions often come up in the context of Horizontal Pod Autoscaling, where the HPA adjusts the replica count on the Deployment, which propagates to the underlying ReplicaSet. Understanding this chain is important for explaining autoscaling behavior and troubleshooting scenarios where scaling does not work as expected.