Scrivio Interview library

Resilience

25 questions in 7 subtopics.

Timeouts

ConceptFoundations7 min read
Explain connection timeout, read (response) timeout and an overall request deadline for an HTTP client in a Spring Boot service. What happens if a RestTemplate or RestClient is created without timeouts?
DebuggingIntermediate7 min read
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?
DesignIntermediate7 min read
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?
DesignAdvanced7 min read
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

ConceptFoundations6 min read
When is it safe to retry a failed call, and why should retries use exponential backoff with jitter?
CodingIntermediate6 min read
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.
DebuggingIntermediate6 min read
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.
LeadershipPrincipal6 min read
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

InternalsFoundations5 min read
Describe the states of a Resilience4j circuit breaker and what moves it between them. What do failureRateThreshold, slidingWindowSize, minimumNumberOfCalls and waitDurationInOpenState control?
DebuggingIntermediate6 min read
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.
LeadershipAdvanced5 min read
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

ConceptFoundations6 min read
What is the bulkhead pattern? Compare Resilience4j's semaphore bulkhead with its thread pool bulkhead.
ScenarioIntermediate6 min read
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?
DesignAdvanced6 min read
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

ConceptFoundations6 min read
Explain the token bucket algorithm and the difference between rate limiting incoming requests on a server and limiting outgoing calls on a client.
DesignIntermediate7 min read
Design rate limiting for a public API with free and paid tiers across 20 gateway instances, with limits per API key per minute.
ScenarioAdvanced6 min read
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?
LeadershipPrincipal6 min read
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

DebuggingFoundations6 min read
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?
InternalsIntermediate6 min read
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?
CodingIntermediate6 min read
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

ConceptFoundations6 min read
What makes a good fallback, and why is a fallback that calls another remote service often a bad idea?
DesignIntermediate6 min read
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?
LeadershipPrincipal6 min read
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?
LeadershipPrincipal6 min read
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?