Node.js · Senior · Question 36 of 75
What does a circuit breaker do?
- 1It restarts the server when CPU is high
- ✓Correct answer: After repeated failures, it stops calling a dependency for a while and fails fast, then tests it with a few requests
- 3It cuts off users who send too many requests
Explanation
It prevents a slow dependency from tying up all resources and gives it time to recover. Combine it with timeouts and a fallback where possible.