CS FundamentalsHardProduct-company placement
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 retries. If every attempt fails instantly, what is the total waiting time, and why add random jitter?
- A. 400 ms; jitter makes the retries faster
- B. 800 ms; jitter is needed only for GET requests
- C. 1,500 ms; jitter spreads out clients so they do not retry in synchronised bursts
- D. 1,600 ms; jitter guarantees success
Correct answer: C. 1,500 ms; jitter spreads out clients so they do not retry in synchronised bursts
100 + 200 + 400 + 800 = 1,500 ms. Without jitter, many clients failing together retry together, hammering the recovering service (a thundering herd).
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 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…
- A circuit breaker protecting calls to a slow service has three states. Which sequence is correct?
- A Kubernetes pod takes 60 seconds to warm its cache after start-up. During that time it should get no traffic but must not be restarted…