Challenge 1: Polling vs Webhook — Possible Solution ==================================================================== RECOMMEND: Webhook. JUSTIFICATION ------------------------------ The whole point of this scenario is that the customer should be notified the INSTANT the driver marks the order delivered — timing matters directly to the user experience here. Polling would mean the app repeatedly asks "is it delivered yet?" on some interval (say, every 10 seconds), which means: - Wasted requests during all the time nothing has changed yet (most of the delivery window). - A real, noticeable delay between the actual delivery event and the customer finding out — up to the length of the polling interval, which directly undermines the "notify immediately" goal. A webhook fixes both problems at once: the delivery-tracking system pushes a notification the moment the driver marks it delivered, with no polling overhead and effectively no delay between the event and the notification going out. WHY THIS WORKS AS AN ANSWER ------------------------------ This is exactly the situation webhooks were designed for, per the chapter's opening comparison: an event that happens at an unpredictable time, where the DELAY between the event and finding out about it has a real, direct cost (a worse customer experience). When immediacy genuinely matters and the event is infrequent/unpredictable rather than constant, a webhook is the better fit over polling.