Resilience
25 questions in 7 subtopics.
Timeouts
Explain connection timeout, read (response) timeout and an overall request deadline for an HTTP client in a Spring Boot service. What happens if aRestTemplate or RestClient is created without timeouts?A service's thread pool is exhausted during a partial outage of a downstream dependency, although read timeout is set to 5 seconds. Thread dumps show threads waiting to get a connection from the HTTP client's connection pool. What is missing?A request passes through a gateway, service A and service B, then the database. The user-facing timeout is 2 seconds. How would you set timeouts at each hop, and what is deadline propagation?Define a timeout and retry standard for all HTTP and database clients used by 60 Spring Boot services. What would the standard contain and how would you make it the default?Retries and backoff
When is it safe to retry a failed call, and why should retries use exponential backoff with jitter?Configure a Resilience4j retry in Spring Boot for a call to an inventory service: 3 attempts, exponential backoff starting at 200 ms, retry only on IOException and HTTP 503, and never on 4xx.A short database slowdown caused a full outage: the gateway retries 3 times, service A retries 3 times and service B retries 3 times. Explain what happened and how you would fix the retry policy.Your products depend on several third-party services (payments, identity, messaging) whose outages have caused your outages. What long-term strategy would you set for critical external dependencies?Circuit breakers
Describe the states of a Resilience4j circuit breaker and what moves it between them. What dofailureRateThreshold, slidingWindowSize, minimumNumberOfCalls and waitDurationInOpenState control?A circuit breaker on a low-traffic admin endpoint never opens although the dependency fails all the time; on a high-traffic endpoint, one breaker opens for a whole service when only one customer's requests fail. Explain both problems.Each team configures circuit breakers differently and some disable them because they are "noisy". How would you set a resilience policy for the organisation?Bulkheads
What is the bulkhead pattern? Compare Resilience4j's semaphore bulkhead with its thread pool bulkhead.A Spring Boot service on Tomcat with 200 threads calls a fast payments API and a slow reporting API. When reporting slows down, payments requests also time out. How would you isolate them, and does moving to virtual threads change the picture?A single bad deployment of a shared service recently took down all customers in all regions. Explain how a cell-based architecture applies the bulkhead idea at system level, and how you would introduce it.Rate limiting
Explain the token bucket algorithm and the difference between rate limiting incoming requests on a server and limiting outgoing calls on a client.Design rate limiting for a public API with free and paid tiers across 20 gateway instances, with limits per API key per minute.A large customer's integration starts sending ten times its usual traffic and degrades the platform for everyone. Rate limits existed but were set too high. What do you do now and what do you change in policy?Peak events such as sales days bring ten times normal traffic and have caused outages two years in a row. How would you build long-term capacity and load management for the platform?Resilience4j
A method has@CircuitBreaker(name = "inventory", fallbackMethod = "fallback") and the fallback is never called; instead the application fails at runtime with a NoSuchMethodException-style error about the fallback. What are the rules for fallback methods?When several Resilience4j annotations are on one method (@Retry, @CircuitBreaker, @RateLimiter, @TimeLimiter, @Bulkhead), in what order are they applied by default in Spring Boot, and why does it matter?Using Resilience4j without annotations, decorate a Supplier<Price> that calls a pricing service with a circuit breaker and retry, and fall back to a cached price. Show the order you would choose.Fallbacks and graceful degradation
What makes a good fallback, and why is a fallback that calls another remote service often a bad idea?Design graceful degradation for a product page that shows price, stock, reviews and recommendations from four services. Which failures should hide a section, which should show stale data, and which should fail the page?A full outage of one cloud region took your platform down for six hours. The board asks for a multi-region or multi-cloud strategy. How would you lead this decision?How would you build a resilience culture in an engineering organisation of 1,000 people: chaos testing, game days, and the trade-off between resilience investment and feature delivery?No question matches these choices.