Rate Limiting, Circuit Breakers & Resilience Patterns interview questions

25 questions from the Rate Limiting, Circuit Breakers & Resilience Patterns course, each with the correct answer and an explanation. Try to answer before you open the answer.

Why Resilience Patterns Exist

1. Why can retries make an outage worse?

  1. They multiply load on a dependency that is already struggling
  2. Retries are always slower than the first attempt
  3. They disable timeouts
  4. They delete cached data
Show answer

Answer: They multiply load on a dependency that is already struggling

Uncontrolled retries amplify traffic exactly when the dependency has the least capacity.

Lesson: Failure Is Normal in Distributed Systems

2. Which pattern primarily protects a service from receiving more requests than it can handle?

  1. Timeout
  2. Fallback
  3. Hedged requests
  4. Rate limiting or load shedding
Show answer

Answer: Rate limiting or load shedding

Rate limiting and load shedding protect the callee by rejecting excess demand.

Lesson: A Map of the Patterns

3. A gateway has a 3-second timeout. What should the timeout of the service it calls be?

  1. Longer than 3 seconds so it can finish
  2. Exactly 3 seconds
  3. Shorter than 3 seconds, leaving room for the gateway to respond
  4. No timeout at all
Show answer

Answer: Shorter than 3 seconds, leaving room for the gateway to respond

Inner timeouts must be shorter than outer ones so work is not wasted after the caller gives up.

Lesson: Deadlines and Timeout Budgets

Timeouts and Retries

4. What is a sensible starting point for a request timeout to a dependency?

  1. The mean latency
  2. One hour
  3. Slightly above the dependency's normal p99 (or p99.9) latency, within the caller's deadline
  4. No timeout, to avoid failing requests
Show answer

Answer: Slightly above the dependency's normal p99 (or p99.9) latency, within the caller's deadline

Basing timeouts on the tail of normal latency cuts off only abnormal requests.

Lesson: Choosing Timeouts

5. Which failure should normally NOT be retried?

  1. A connection reset
  2. HTTP 400 Bad Request caused by invalid input
  3. HTTP 503 Service Unavailable
  4. A timeout on an idempotent GET
Show answer

Answer: HTTP 400 Bad Request caused by invalid input

A 400 is a permanent error; repeating the same request will fail the same way.

Lesson: Retries, Backoff and Jitter

6. Three layers each retry 3 times. How many calls can one user request cause at the deepest dependency in the worst case?

  1. 27
  2. 3
  3. 9
  4. 81
Show answer

Answer: 27

3 × 3 × 3 = 27 attempts, which is why retries should happen at one layer with a budget.

Lesson: Retry Amplification, Retry Budgets and Hedging

Circuit Breakers

7. What happens to calls while a circuit breaker is open?

  1. They fail fast (or use a fallback) without calling the dependency
  2. They are queued until the dependency recovers
  3. They are retried immediately
  4. They are sent to a random service
Show answer

Answer: They fail fast (or use a fallback) without calling the dependency

An open breaker short-circuits calls to protect both caller and dependency.

Lesson: How a Circuit Breaker Works

8. Which Resilience4j setting makes very slow calls count against the breaker even if they eventually succeed?

  1. permitted-number-of-calls-in-half-open-state
  2. max-attempts
  3. wait-duration
  4. slow-call-duration-threshold with slow-call-rate-threshold
Show answer

Answer: slow-call-duration-threshold with slow-call-rate-threshold

Slow-call thresholds let the breaker open when a dependency becomes too slow, not only when it errors.

Lesson: Circuit Breakers in Resilience4j and Polly

9. Why should a retry policy usually not retry when a circuit breaker reports it is open?

  1. Open-circuit errors are permanent bugs
  2. Retries cannot be combined with breakers
  3. The breaker has decided the dependency is unhealthy; retrying immediately just spins and wastes time
  4. It would close the breaker
Show answer

Answer: The breaker has decided the dependency is unhealthy; retrying immediately just spins and wastes time

An open breaker fails fast by design; retrying it adds latency without any chance of success until it half-opens.

Lesson: Designing Breakers and Combining Patterns

Isolation and Graceful Degradation

10. What does a bulkhead limit?

  1. The number of retries
  2. The size of HTTP responses
  3. The share of resources (such as concurrent calls) one dependency or workload can consume
  4. The cache TTL
Show answer

Answer: The share of resources (such as concurrent calls) one dependency or workload can consume

Bulkheads cap resource usage per dependency so failures stay contained.

Lesson: Bulkheads

11. The reviews service for a product page is down. What is the best behaviour?

  1. Return HTTP 500 for the product page
  2. Render the page without the reviews section
  3. Retry the reviews call forever
  4. Redirect users to the home page
Show answer

Answer: Render the page without the reviews section

Optional features should degrade without failing the critical path.

Lesson: Fallbacks and Graceful Degradation

12. What is a brownout in this context?

  1. Deliberately degrading optional features under high load to protect critical paths
  2. A full power failure in a datacentre
  3. A database backup
  4. A type of rate limiter header
Show answer

Answer: Deliberately degrading optional features under high load to protect critical paths

Brownouts shed optional work proactively so core functionality stays healthy.

Lesson: Kill Switches and Feature Flags for Resilience

Rate Limiting

13. Which status code and header should a rate-limited API return?

  1. 429 Too Many Requests with Retry-After
  2. 500 with Location
  3. 404 with ETag
  4. 301 with Cache-Control
Show answer

Answer: 429 Too Many Requests with Retry-After

429 signals rate limiting, and Retry-After tells clients when to try again.

Lesson: Why and Where to Rate Limit

14. Which algorithm allows short bursts while enforcing a long-term average rate?

  1. Fixed window with a tiny window
  2. No rate limiting
  3. Random dropping
  4. Token bucket
Show answer

Answer: Token bucket

Token buckets accumulate tokens up to a capacity, permitting bursts within an average rate.

Lesson: Rate Limiting Algorithms

15. Why must a distributed rate limiter update its counter atomically?

  1. Redis requires it for all keys
  2. To make responses smaller
  3. Otherwise concurrent requests on different instances could all read the same count and exceed the limit
  4. To avoid using TTLs
Show answer

Answer: Otherwise concurrent requests on different instances could all read the same count and exceed the limit

Atomic read-modify-write prevents race conditions between instances.

Lesson: Distributed Rate Limiting

Overload Protection

16. Why can accepting every request under overload reduce the number of successful responses?

  1. Servers refuse to queue requests
  2. Rejected requests use more CPU than accepted ones
  3. Queues grow until most requests time out, so busy work produces few useful results
  4. Load balancers stop routing traffic
Show answer

Answer: Queues grow until most requests time out, so busy work produces few useful results

Overloaded queues make almost every request too slow; shedding keeps accepted requests within their deadlines.

Lesson: Load Shedding

17. What signal do adaptive concurrency limiters mainly use to reduce the limit?

  1. Number of deploys
  2. Rising latency, which indicates queueing
  3. Disk usage on the client
  4. HTTP 200 responses
Show answer

Answer: Rising latency, which indicates queueing

Latency above the baseline indicates requests are queueing, so the limit is lowered.

Lesson: Concurrency Limits and Back-Pressure

18. In adaptive client-side throttling, what happens when the backend accepts nearly all requests?

  1. The local rejection probability stays near zero
  2. The client drops half its traffic anyway
  3. The client stops sending entirely
  4. The client doubles its traffic
Show answer

Answer: The local rejection probability stays near zero

With accepts close to requests, the formula yields a rejection probability near zero.

Lesson: Client-Side Throttling and Cooperative Clients

Resilience in Libraries, Meshes and APIs

19. What does outlier detection in Envoy or Istio do?

  1. Temporarily removes individual hosts that return repeated errors from the load-balancing pool
  2. Encrypts traffic between services
  3. Limits requests per user
  4. Caches responses at the edge
Show answer

Answer: Temporarily removes individual hosts that return repeated errors from the load-balancing pool

Outlier detection ejects misbehaving hosts so traffic goes to healthy ones.

Lesson: Resilience in the Service Mesh and Gateway

20. A client retries POST /payments with the same Idempotency-Key after a timeout. What should the server do if the first attempt succeeded?

  1. Charge the customer again
  2. Return 404
  3. Ignore the key and process normally
  4. Return the stored result of the first attempt without charging again
Show answer

Answer: Return the stored result of the first attempt without charging again

The stored response is replayed, making the retry safe.

Lesson: Idempotency Keys for Safe Retries

21. Why might a platform team provide a shared HTTP client template?

  1. To force every service to use the same database
  2. To remove the need for monitoring
  3. So all services start with safe timeouts, retries, breakers and metrics by default
  4. To disable retries everywhere
Show answer

Answer: So all services start with safe timeouts, retries, breakers and metrics by default

Standard templates make resilient behaviour the default rather than an afterthought.

Lesson: Choosing and Standardising Resilience Libraries

Testing, Observing and Revision

22. What is Toxiproxy used for?

  1. Encrypting service traffic
  2. Load balancing production traffic
  3. Simulating network faults such as latency and dropped connections between a service and its dependency
  4. Storing idempotency keys
Show answer

Answer: Simulating network faults such as latency and dropped connections between a service and its dependency

Toxiproxy injects network conditions so resilience behaviour can be tested.

Lesson: Testing Resilience with Fault Injection

23. Why should fallback usage be monitored?

  1. Fallbacks are always errors
  2. A fallback can hide a long-running failure, such as stale data being served for days
  3. Fallbacks increase CPU usage dramatically
  4. Fallbacks cannot be logged
Show answer

Answer: A fallback can hide a long-running failure, such as stale data being served for days

Graceful degradation keeps users happy but must not let failures go unnoticed.

Lesson: Observing Resilience Patterns

24. In the case study, why is the payments charge call not retried automatically by a generic policy?

  1. A blind retry could double-charge; idempotency keys and reconciliation make retries safe instead
  2. Payments never fail
  3. Retries are forbidden by HTTP
  4. The breaker handles all payment errors
Show answer

Answer: A blind retry could double-charge; idempotency keys and reconciliation make retries safe instead

Non-idempotent money operations need idempotency keys rather than generic retries.

Lesson: Case Study: Hardening a Checkout Flow

25. Which combination best protects a caller from a dependency that suddenly becomes very slow?

  1. Longer timeouts and more retries
  2. Removing all timeouts
  3. Caching the dependency's errors forever
  4. Short timeouts, a circuit breaker with slow-call detection and a bulkhead
Show answer

Answer: Short timeouts, a circuit breaker with slow-call detection and a bulkhead

Timeouts bound waiting, the breaker stops calls to a slow dependency and the bulkhead caps resource use.

Lesson: Revision and Interview Questions

← Back to the course