0
0
Microservicessystem_design~20 mins

Horizontal Pod Autoscaler in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Horizontal Pod Autoscaler Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does Horizontal Pod Autoscaler decide to scale pods?

Imagine you have a service running in Kubernetes. The Horizontal Pod Autoscaler (HPA) adjusts the number of pods based on certain metrics. Which metric does HPA primarily use to decide when to add or remove pods?

ANumber of active network connections to the pods
BCPU utilization of the pods compared to a target threshold
CTotal disk space used by the pods
DNumber of pods currently running
Attempts:
2 left
💡 Hint

Think about what resource usage usually indicates workload intensity.

Architecture
intermediate
2:00remaining
Which component in Kubernetes is responsible for implementing Horizontal Pod Autoscaler?

In Kubernetes architecture, which component actively monitors metrics and adjusts the number of pods for Horizontal Pod Autoscaler?

Akube-controller-manager
Bkube-scheduler
Ckube-proxy
Detcd
Attempts:
2 left
💡 Hint

Think about which component manages controllers and their loops.

scaling
advanced
2:00remaining
What happens if the metrics server is unavailable for Horizontal Pod Autoscaler?

Consider a Kubernetes cluster where the metrics server stops responding. What is the expected behavior of the Horizontal Pod Autoscaler during this period?

AHPA scales pods randomly without metrics
BHPA immediately scales down all pods to zero
CHPA stops scaling and keeps the current number of pods until metrics are available again
DHPA scales pods up to the maximum limit regardless of load
Attempts:
2 left
💡 Hint

Think about how autoscaling depends on metrics and what happens if metrics are missing.

tradeoff
advanced
2:00remaining
What is a tradeoff when setting a very low CPU utilization target in HPA?

If you configure the Horizontal Pod Autoscaler with a very low CPU utilization target (e.g., 10%), what is a likely tradeoff?

APods will scale up quickly, increasing resource costs but improving responsiveness
BPods will scale down to zero frequently, causing downtime
CPods will never scale up, causing slow response times
DPods will ignore CPU usage and scale based on memory instead
Attempts:
2 left
💡 Hint

Consider what happens if the threshold to add pods is very low.

estimation
expert
3:00remaining
Estimate the number of pods needed with HPA given load and CPU usage

Your service currently runs 5 pods, each with 50% CPU utilization. The target CPU utilization for HPA is 40%. If the incoming load doubles, approximately how many pods will HPA scale to maintain the target?

A5 pods
B20 pods
C7 pods
D10 pods
Attempts:
2 left
💡 Hint

Think about how doubling load affects CPU usage and how many pods are needed to keep utilization at 40%.