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?
- A. 8
- B. 6
- C. 3
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A VM costs ₹10 an hour on demand. A one-year reserved commitment for the same VM costs ₹52,560, payable whatever the usage. Above what…
- A client calls a payment API with exponential backoff: wait 100 ms before the first retry and double the wait each time, for up to 4…
- A mobile client sends POST /payments, the server charges the card, but the response is lost on a flaky network, so the client retries. How…
- A feed API uses ?offset=20&limit=20 pagination. While a user reads page 1, 5 new items are inserted at the top. What goes wrong on page 2…
- During a network partition between two data centres, a replicated database must either reject some writes or accept writes on both sides…
- An order service and a payment service each own their database. Placing an order must reserve stock, charge the card and create the order…