Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You manage a stateless microservice on Google Kubernetes Engine (GKE) that experiences fluctuating traffic with brief drops followed by sudden spikes. Because the application requires 90 seconds to warm up caches, rapid downscaling causes Pod thrashing and increased latency when traffic rebounds.
You need to configure the Horizontal Pod Autoscaler (HPA) with the following requirements:
600 seconds) stabilization window and limit removal to the more conservative of 10% of current replicas or 1 Pod per minute.0 seconds stabilization) and allow adding the larger of 50% of current replicas or 4 Pods per minute.How should you configure autoscaling to meet these requirements?
maxScaledInReplicas and timeWindowSec) and set a 600-second stabilization period on the GKE node pool's underlying instance groups.Compute Engine Managed Instance Group (MIG) autoscalers provide a stabilization period and scale-in controls (maxScaledInReplicas and timeWindowSec) to limit how fast VM instances are removed from a standalone MIG after a drop in load. This helps VM-based workloads with long initialization times absorb sudden traffic rebounds.
stabilizationWindowSeconds, Pods, or Percent scaling policies.0 seconds stabilization) with 50% or 4 Pods per minute limits.Your application ran directly on Compute Engine VMs in a Managed Instance Group (outside of GKE) and needed to cap VM scale-in velocity over a trailing time window.
Although GKE HPA spec.behavior and Compute Engine MIG scale-in controls solve conceptually similar oscillation problems, they belong to completely separate compute platforms and cannot be interchanged.
optimize-utilization autoscaling profile for GKE Cluster Autoscaler and define a PodDisruptionBudget on the Deployment to restrict the rate at which HPA removes Pod replicas during traffic dips.The Cluster Autoscaler (CA) manages the number of worker nodes in GKE node pools, while a PodDisruptionBudget (PDB) protects workloads during voluntary node disruptions such as upgrades, node drains, and CA node consolidation. The optimize-utilization profile instructs CA to pack Pods more tightly and remove underutilized nodes faster.
optimize-utilization tells CA to reclaim underutilized nodes more aggressively, which is the opposite of stabilizing capacity during brief traffic dips.minAvailable or maxUnavailable during voluntary infrastructure disruptions, not application-level autoscaling.Pods or Percent limits per 60 seconds or a 600-second metric stabilization window.You wanted to reclaim idle cluster nodes faster to reduce infrastructure costs while ensuring that node-drain operations never take too many replicas offline simultaneously.
Always pair HPA with a PDB for high availability during node maintenance, but use HPA's spec.behavior to control Pod scaling speed and thrashing.
spec.behavior field with scaleDown (stabilizationWindowSeconds: 60, selectPolicy: Max, and policies for Percent: 10 and Pods: 1 over periodSeconds: 60) and scaleUp (stabilizationWindowSeconds: 600, selectPolicy: Min, and policies for Percent: 50 and Pods: 4 over periodSeconds: 60).This option uses the correct HPA spec.behavior structure (stabilizationWindowSeconds, selectPolicy, Percent, and Pods), but it inverts the values for scaleDown and scaleUp. In HPA terminology, selectPolicy: Max selects the policy that produces the largest change in replica count, while selectPolicy: Min selects the policy that produces the smallest change.
scaleDown.stabilizationWindowSeconds: 60 shortens the observation window well below the 5-minute default and far short of the required 10 minutes (600 seconds). Furthermore, selectPolicy: Max forces the HPA to remove the maximum number of Pods allowed between 10% and 1 Pod, violating the requirement to be conservative.scaleUp.stabilizationWindowSeconds: 600 forces the HPA to choose the lowest recommendation from the past 10 minutes before adding Pods, delaying scale-up during sudden traffic spikes.scaleUp.selectPolicy: Min caps additions at the smaller of 50% or 4 Pods per minute, slowing recovery when demand surges.Max vs. Min refers to change magnitude: Max maximizes replica delta (more aggressive), whereas Min minimizes replica delta (more conservative), regardless of whether scaling up or down.scaleDown.stabilizationWindowSeconds makes the HPA hyper-reactive to brief dips.scaleUp window keeps workloads under-provisioned during traffic bursts.The application experienced brief, false-positive CPU spikes at startup that you wanted to ignore for 10 minutes before scaling up, while wanting to reclaim unused Pods within 60 seconds during idle periods.
A common misconception is assuming selectPolicy: Max on scaleDown means "maximum stability." In reality, selectPolicy: Min is what enforces the most conservative rate limit.
spec.behavior field with scaleDown (stabilizationWindowSeconds: 600, selectPolicy: Min, and policies for Percent: 10 and Pods: 1 over periodSeconds: 60) and scaleUp (stabilizationWindowSeconds: 0, selectPolicy: Max, and policies for Percent: 50 and Pods: 4 over periodSeconds: 60).In Kubernetes and GKE, the Horizontal Pod Autoscaler (autoscaling/v2) exposes the spec.behavior field to give developers fine-grained control over the velocity and timing of scale-up and scale-down operations. Rather than relying solely on default settings, you can define independent stabilization windows and scaling policies (Pods and Percent) for each scaling direction.
scaleDown.stabilizationWindowSeconds: 600 instructs the HPA controller to retain the highest desired replica recommendation calculated over the past 600 seconds (10 minutes). Brief traffic dips no longer trigger premature Pod termination before caches can warm up again.Pods (value: 1) and Percent (value: 10) with periodSeconds: 60 and selectPolicy: Min ensures the HPA chooses whichever policy removes fewer Pods per minute, preventing abrupt capacity loss.scaleUp.stabilizationWindowSeconds: 0 applies scale-up recommendations without delay, while selectPolicy: Max selects whichever policy (50% or 4 Pods per 60 seconds) adds more replicas during a surge.Pods) and proportional (Percent) replica changes per time interval.Deployment without interfering with cluster-wide node autoscaling.Unlike cluster-level node settings or disruption budgets, spec.behavior directly governs HPA replica calculations. It resolves Pod thrashing at the source while preserving rapid burst capacity.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated