Kubernetes Rollouts Interview Questions: Rolling Updates and Rollbacks
Reviewed by Mark Dickie · Last updated
5 questions on this page you can answer and see marked on the spot. Go to the first one
Kubernetes rollouts are the process by which a Deployment replaces running pods with pods built from a new pod template. Interviewers usually test whether you can explain how ReplicaSets shift pods during a rolling update, how maxSurge and maxUnavailable set the pace, and how to return to an earlier revision with kubectl rollout undo. Expect follow-ups on readiness probes, because a rollout only moves forward when new pods report Ready. Be ready to contrast the RollingUpdate and Recreate strategies.
How does a rolling update replace pods in Kubernetes?
| Concept | What to explain | Failure mode to name |
|---|---|---|
| maxSurge | Extra pods allowed above the replica count during an update (default 25%) | Needs spare cluster capacity, or the rollout stalls with Pending pods |
| maxUnavailable | Pods allowed to be missing below the replica count (default 25%) | The API server rejects a spec where both maxSurge and maxUnavailable are 0 |
| readinessProbe | Decides when a new pod counts toward rollout progress | Without a probe, traffic can reach pods that are still starting |
| progressDeadlineSeconds | Time before a stuck rollout is marked failed (default 600) | Status shows ProgressDeadlineExceeded, but the old pods keep running |
| revisionHistoryLimit | How many old ReplicaSets are kept for rollback (default 10) | Setting it to 0 deletes the history, so undo is no longer possible |
| Recreate strategy | Terminates all old pods before creating new ones | Causes downtime, which RollingUpdate avoids |
How do you practise a rollout and rollback by hand?
- Create a Deployment named web with replicas: 4 and the nginx:1.25 image, then apply it.
- Run kubectl set image deployment/web nginx=nginx:1.26 and watch progress with kubectl rollout status deployment/web.
- Set the image to a tag that does not exist, and observe the new pods in ImagePullBackOff while the old pods keep serving.
- Inspect revisions with kubectl rollout history deployment/web and the ReplicaSets with kubectl get rs.
- Recover with kubectl rollout undo deployment/web, then confirm the old pod template is now the newest revision: the revision number goes up (for example, from 2 to 3), and the image in that revision matches the earlier version.
Key facts
- Tarmac has 21 Kubernetes interview questions on this topic, 10 of them on this page, at difficulty 1–5 of 5.
- Tarmac tracked 1,603 job postings asking for Kubernetes in November 2026.
- Roles asking for Kubernetes advertise a median base salary of £77,000, across 605 job postings as of November 2026.
- Tarmac last reviewed these Kubernetes interview questions on 3 December 2026.
At a glance
| Questions | 10 shown · 21 in the bank |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, Fill in the blank, Short answer, True / false, Ordering, Design exercise, Flashcard |
What you'll review
- rolling updates
- rollback
- deployment strategies
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
When you update the container image in a Kubernetes Deployment without specifying a strategy, which rollout strategy is used by default?#
Options
Show answer
The default rollout strategy for a Kubernetes Deployment is RollingUpdate. It replaces old Pods with new ones gradually, so the application stays available during the update. Recreate must be set explicitly in spec.strategy.type if you want all old Pods stopped before new ones start.
A Kubernetes Deployment defaults to the RollingUpdate strategy unless you explicitly set spec.strategy.type to Recreate. RollingUpdate gradually replaces old Pods with new ones, keeping the application available during the update. Recreate, the only other built-in strategy type, terminates all old Pods before creating new ones, causing downtime. Blue-green and canary are release patterns that are not built-in Deployment strategy types.
By default, a rolling update allows at most _____ of the Deployment's Pods to be unavailable at any time during the rollout. (Express your answer as a percentage without the % sign.)#
Show answer
By default, a rolling update allows at most 25 of the Deployment's Pods to be unavailable at any time during the rollout. (Express your answer as a percentage without the % sign.)
The default value of maxUnavailable for a Deployment's RollingUpdate strategy is 25%, so up to a quarter of the desired replica count can be unavailable while the rollout proceeds. The field accepts either a percentage string or an absolute integer, and the percentage form is the default.
Which kubectl command reverts a Deployment named web-app back to its previous rollout revision?#
Show answer
kubectl rollout undo deployment/web-app
kubectl rollout undo deployment/web-app reverts the Deployment to its immediately previous revision, which is the rollback behavior the question asks for. The rollout undo subcommand works on the Deployment's stored ReplicaSet revision history. You can also target a specific revision with the --to-revision flag.
In a Kubernetes Deployment with maxUnavailable: 0 and maxSurge at least 1, the rolling update is configured so that it does not plan any step that takes the number of available pods below the desired replica count. It creates a surge pod and waits for that pod to become available before removing an old pod. True or false?#
Options
Show answer
True. A Kubernetes Deployment with maxUnavailable: 0 and maxSurge at least 1 is configured so its rolling update adds a new pod first and removes an old pod only after the replacement is available. The rollout's planned scale-downs therefore never take available pods below the desired count, though crashes and probe failures are outside this plan.
The maxUnavailable field sets how many pods below the desired count the rolling update may take down, so a value of 0 tells the Deployment controller not to plan any step that reduces available pods under the desired replica count. With maxSurge of at least 1, the controller creates a surge pod, waits until it is Ready and has been available for minReadySeconds, and only then scales down an old pod. The statement describes the configured plan of the rollout rather than an absolute guarantee, since crashes, failed probes, and node events can still reduce available pods. Also, the API rejects a Deployment where both maxUnavailable and maxSurge are 0, which is why maxSurge must be at least 1 here.
kubectl rollout undo deployment/web can revert to the previous version because Kubernetes retains the old ReplicaSets as revision history.#
Options
Show answer
True. Every Deployment update creates a new ReplicaSet and retains prior ones (up to revisionHistoryLimit, default 10) scaled to zero. kubectl rollout undo scales a previous ReplicaSet back up and the current one down — a fast rollback with no image rebuild. Setting revisionHistoryLimit: 0 discards that history, leaving undo nothing to revert to, which is a common self-inflicted trap.
True. Each Deployment update creates a new ReplicaSet and keeps prior ones (up to revisionHistoryLimit, default 10) scaled to zero. rollout undo simply scales a previous ReplicaSet back up and the current one down — a fast rollback with no rebuild. If you set revisionHistoryLimit: 0, that history is discarded and undo has nothing to roll back to, which is a trap people hit when trimming clutter.
Explain how a Deployment achieves a zero-downtime rolling update, and the role readiness probes play in it.#
Show answer
On a template change, the Deployment creates a new ReplicaSet and shifts replicas gradually: it scales the new ReplicaSet up and the old one down a few Pods at a time, bounded by maxSurge (extra Pods allowed above desired) and maxUnavailable (how many can be missing). A new Pod only counts as available — and the old one is only removed — once it passes its readiness probe, so traffic is shifted to Pods that can actually serve. If the readiness probe is missing or wrong, Kubernetes routes traffic to not-yet-ready Pods and you get errors during the rollout, defeating the zero-downtime goal.
Zero-downtime comes from overlapping old and new Pods and only retiring an old Pod after a new one is ready. maxSurge/maxUnavailable control how aggressive the swap is, and the readiness probe is the gate that decides 'ready to receive traffic.' Skipping the readiness probe is the usual reason a 'rolling' update still drops requests.
During a default rolling update of a Deployment, order the steps the controller repeats to swap one Pod from the old version to the new.#
Put these in order
Show answer
During a default rolling update, a Deployment swaps one Pod at a time in this order: create or reuse a ReplicaSet for the new Pod template, scale the new ReplicaSet up by one within the maxSurge limit, wait for that Pod to pass its readiness probe, then scale the old ReplicaSet down by one. The controller repeats this until the new ReplicaSet runs full replicas and the old one reaches zero. The readiness gate is what keeps requests served: an old Pod is removed only after its replacement can take traffic.
A rolling update overlaps old and new: bring up a new Pod, wait until it's ready (the readiness probe is the gate), only then retire an old one — keeping enough Pods serving throughout, bounded by maxSurge and maxUnavailable. Retiring the old Pod before the new one is ready is exactly the mistake that turns a 'zero-downtime' rollout into dropped requests. The cycle continues until the new ReplicaSet fully replaces the old.
Design a highly-available, zero-downtime deployment of a stateless HTTP API on Kubernetes.#
Show answer
Workload. A Deployment, minimum 3 replicas (one per AZ as a floor). Each container sets CPU/memory requests so the scheduler can place and reserve correctly, with limits set to avoid noisy-neighbour blast radius (memory limit ≈ request to stay near Guaranteed for the critical tier).
Health. readinessProbe gates Service traffic; livenessProbe restarts a wedged container; a startupProbe (or generous initialDelay) covers the 30s cache warm-up so liveness doesn't kill a slow starter and traffic isn't routed until caches are warm.
Availability. topologySpreadConstraints across topology.kubernetes.io/zone (and hostname) so replicas are balanced over AZs and nodes — a single node or AZ loss removes at most ~1/3 of capacity. A PodDisruptionBudget (minAvailable: 2 or maxUnavailable: 1) protects against voluntary disruption during drains/upgrades.
Rollout. RollingUpdate with maxUnavailable: 0, maxSurge: 1 (or 25%), readiness-gated so only ready Pods receive traffic. A preStop hook + SIGTERM handling with a terminationGracePeriod drains in-flight requests (deregister from endpoints, finish, then exit). kubectl rollout undo for fast rollback on a bad deploy.
Scaling. An HPA (CPU or RPS/custom metric) from min 3 to a peak-sized max absorbs the 5× swing; Cluster Autoscaler adds nodes when Pods would otherwise stay Pending. Keep a replica floor for headroom because scale-up isn't instant.
Failure modes. Node loss → spread + controller reschedules survivors. AZ loss → spread caps the damage, LB routes to healthy AZs, HPA/CA backfill. Bad deploy → readiness gating stalls the rollout, PDB protects capacity, rollout undo reverts. Autoscaler lag → replica floor + surge headroom. Ingress/LB health checks pull unhealthy Pods/nodes out.
A strong answer treats 'highly available' as concrete mechanisms, not a buzzword: multiple replicas spread across failure domains (topology spread / anti-affinity), a PodDisruptionBudget for voluntary disruptions, readiness-gated rolling updates with graceful shutdown for deploys, and an HPA + Cluster Autoscaler for the traffic swing. The recurring interview signal is whether the candidate separates readiness from liveness and remembers that spreading replicas is what actually survives a node/AZ failure.
A dynamic array starts with capacity 1 and doubles its capacity whenever it becomes full. What is the amortized time complexity of a single append (push-back) operation, and how does the doubling strategy ensure this bound? Briefly justify your answer using the accounting method or potential method.#
Show answer
The amortized cost per append is Θ(1). When the array doubles from capacity c to 2c, it copies c elements. The previous resize left capacity c holding about c/2 elements, so roughly c/2 cheap insertions occur before this resize. Charging 3 coins per insertion (1 for the write, 2 saved toward a future copy) gives about c/2 × 2 = c saved coins, which pays for copying the c elements. Summing over n appends gives O(n) total work, so each append is O(1) amortized.
The amortized cost per append is Θ(1). A resize from capacity c to 2c copies c elements. The previous resize left the array at capacity c with about c/2 elements, so only about c/2 cheap insertions happen before the next doubling, not c. Under the accounting method, each insertion is charged 3 coins: 1 pays for the write and 2 are saved as credit on the element being inserted. Those roughly c/2 insertions save about 2 × c/2 = c coins, exactly enough to pay for copying the c elements at the next resize. Because every resize is paid for by credit already stored, total work over n appends is O(n), giving O(1) amortized per append.
A Kubernetes Deployment with replicas=8 uses a RollingUpdate strategy with maxUnavailable=3 and maxSurge=2. A PodDisruptionBudget with minAvailable=6 selects the same pod labels. There is no node maintenance; the rollout is triggered only by a container image change. Which statement accurately describes what happens?#
Options
Show answer
A Deployment's rolling update is governed by its own maxUnavailable and maxSurge settings, not by a PodDisruptionBudget. The Deployment controller scales ReplicaSets directly and never calls the Eviction API, so a PDB with minAvailable=6 does not limit or block the rollout.
The Deployment controller's rolling update scales the new ReplicaSet up and the old ReplicaSet down directly. It enforces two constraints from the Deployment's own strategy: total pods must not exceed replicas + maxSurge (10), and unavailable pods (desired minus available) must not exceed maxUnavailable (3). The controller does not invoke the Eviction API; it changes the replica count of the old ReplicaSet, and the ReplicaSet controller then deletes pods. PodDisruptionBudgets are only consulted by the Eviction subresource, which is what kubectl drain and other voluntary-disruption tools call. Because the rollout bypasses eviction, the PDB with minAvailable=6 has no effect on it. The statement that the rollout is capped at 2 unavailable pods would only hold if the PDB were enforced on controller-driven deletions, which it is not. Rejection at admission is also wrong: the two settings are not incompatible, they simply govern different mechanisms.
Related interview questions
Job market
See kubernetes salaries and hiring demand from live job postings.
The other 11 questions
This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 11 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 answers per 30 days, each marked with written feedback