Reported interview periodNov 2025–Aug 2026
Circuit Breaker and Replica Failover
Implement a circuit breaker that protects a dependency after repeated failures, then use it to route work across database replicas.
Practice focusRequirements - CLOSED permits calls. A success resets the consecutive-failure count. - After failure threshold consecutive supplier failures, transition to OPEN and propagate the failure. - While OPEN , reject calls without invoking the supplier. - Raise the provided CircuitOpenError for breaker-generated denial; propagate supplier errors unchanged. An error message containing the word OPEN is not a denial signal. - After recovery timeout , permit one HALF OPEN probe. Success closes the breaker; failure reopens it and restarts the timeout.…