Day 21: Giving Up Quickly on a Slow Service, and Keeping the Damage in One Room
Illustrative interview practice. Generic company names and hostnames do not represent any specific organization.
Scenario
Interviewer A shop's website asks a stock service whether each item is available. The stock service becomes very slow. How do circuit breakers and bulkheads stop that from taking the whole website down? And why is an instant failure better than waiting for a timeout?
In plain words
A website is usually many small services that call each other. Here one of them, the stock service, has slowed to a crawl. The rest of the site is fine, for now.
The question names two protections and asks what each one does. It also asks you to defend an idea that sounds wrong at first: that failing straight away can be kinder than waiting.
You are expected to explain both protections in your own words, with one small worked example and what the user sees while they are in force.
Words you need
| Word | What it means |
|---|---|
| Dependency | Another service that yours has to call to do its job. Here, the stock service. |
| Timeout | The longest a caller will wait for a reply before giving up. |
| Worker | One of a fixed number of hands a service has for handling requests. Often called a thread. A busy or waiting worker can do nothing else. |
| Circuit breaker | A small piece of code that watches the calls to one dependency and can stop making them for a while. |
| Bulkhead | A dividing wall. In software, a separate, fixed share of workers or connections for each dependency. |
Your answer
2:00
Observe → Hypothesise → Investigate → Mitigate → Prevent. The timer is optional; your answer is not auto-submitted.
0 / 20,000 characters · Not saved