Rate Limiting, Circuit Breakers & Resilience Patterns Interview Questions Hindi mein

Rate Limiting, Circuit Breakers & Resilience Patterns कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।

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
जवाब देखें

जवाब: They multiply load on a dependency that is already struggling

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

पाठ: 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
जवाब देखें

जवाब: Rate limiting or load shedding

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

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: HTTP 400 Bad Request caused by invalid input

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

पाठ: 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
जवाब देखें

जवाब: 27

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

पाठ: 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
जवाब देखें

जवाब: They fail fast (or use a fallback) without calling the dependency

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

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: The share of resources (such as concurrent calls) one dependency or workload can consume

Bulkheads cap resource usage per dependency so failures stay contained.

पाठ: 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
जवाब देखें

जवाब: Render the page without the reviews section

Optional features should degrade without failing the critical path.

पाठ: 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
जवाब देखें

जवाब: Deliberately degrading optional features under high load to protect critical paths

Brownouts shed optional work proactively so core functionality stays healthy.

पाठ: 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
जवाब देखें

जवाब: 429 Too Many Requests with Retry-After

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

पाठ: 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
जवाब देखें

जवाब: Token bucket

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

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: Rising latency, which indicates queueing

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

पाठ: 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
जवाब देखें

जवाब: The local rejection probability stays near zero

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

पाठ: 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
जवाब देखें

जवाब: Temporarily removes individual hosts that return repeated errors from the load-balancing pool

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

पाठ: 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
जवाब देखें

जवाब: Return the stored result of the first attempt without charging again

The stored response is replayed, making the retry safe.

पाठ: 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
जवाब देखें

जवाब: So all services start with safe timeouts, retries, breakers and metrics by default

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

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: 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
जवाब देखें

जवाब: 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.

पाठ: Revision and Interview Questions

← कोर्स पर वापस जाएँ