All guide activities

CH-07 · CHAPTER REVIEW

Queues events and asynchronous work

Solve these two questions after studying the chapter. State your assumptions and explain your reasoning.

Read. Try. Defend.

Companion to the Buildfest System Design guides.

Chapter review: two questions

Attempt both questions before opening the model answers.

Question 1

Jobs arrive at 80/s. Each worker handles an assumed 25/s. How many workers are needed to drain a 1,800-job backlog within 60 seconds while arrivals continue?

Reveal model answer

Draining requires 30 jobs/s spare, so processing must reach at least 110/s. ceil(110/25) gives five workers, with 125/s capacity and an ideal drain time 1,800/(125-80) = 40 seconds. Four would take 90 seconds and miss the goal. State constant-rate and no-retry assumptions.

Question 2

A worker sends a notification, crashes and never acknowledges. Explain the next likely broker action and design safe handling.

Reveal model answer

The broker may redeliver because completion was not acknowledged. Preserve a stable event/operation identity and coordinate deduplication with the intended effect. For uncertain external sends, use the provider's contract or reconciliation; a separate local flag alone is not a universal exactly-once guarantee.

Answers stay in this tab. Download before leaving. This practice is not graded or saved to your account.