CS FundamentalsHardProduct-company DevOps interview

A Kubernetes HorizontalPodAutoscaler targets 60% average CPU. There are 4 pods averaging 90% CPU. The HPA uses desired = ceil(current replicas x current metric / target). How many replicas will it ask for?

  1. A. 8
  2. B. 6
  3. C. 3
  4. D. 2

Correct answer: B. 6

desired = ceil(4 × 90/60) = 6, which brings the average back to about 60%. Doubling gives 8, inverting the ratio gives ceil(4 × 60/90) = 3, and flooring that gives 2.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic