Stop Calling What Is Down

Hard data structure and algorithm practice puzzle.

A service that keeps calling a broken dependency makes an outage worse. A circuit breaker stops it. Each call is [time, ok], with ok 1 for success. After threshold failures in a row the breaker opens, and every call during the next cooldown time units is rejected without being sent. The first call after that is a trial: if it succeeds the breaker closes and the count resets, and if it fails the breaker opens again from that moment. Return how many calls were rejected.

Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free to play, with no account.

Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.

Then grow it into a real project with the Software Engineer button: this puzzle becomes the Event Coverage Report, a pipeline you can run and download. See every Software Engineer project.

More Computer Systems puzzles

All 23 Computer Systems practice problems

Browse all 676 puzzles