SoloMedium9m

The Black Friday Checkout

#black-friday-war-room — 8-second checkout

50k orders/hour but checkout blocks on email, push, inventory, and analytics inside the HTTP request. Customers refresh → double orders. Stripe timeouts.

The trap: SendGrid and analytics in the synchronous path — customer waits 3.4s+ for "Order Confirmed".

Your task

Build `MessageQueue` and refactor `checkoutAsync()` in `checkout_system.js`: validate → charge → publish order.created → respond; workers handle email, push, inventory, analytics.

Book: pub/sub decoupling · Prod: only payment belongs in the request — everything else goes to the queue.

Skills you'll prove

javascriptnodejsmessage-queueevent-drivenasync-processingpub-subperformancebook-vs-prod

Interview Tip

When asked about message queues or async processing, say: "The rule is simple — if the user doesn't need it to see 'success,' it shouldn't be in the request path. Payment must be synchronous. Email, notifications, analytics — publish an event and let workers handle it. I refactored a checkout system where we were making customers wait 3.4 seconds while we sent emails and updated analytics. Moving those to a message queue cut response time by 40% and eliminated timeout-based double orders. The key trade-off is eventual consistency — the email might arrive 2 seconds after the HTTP response, and that's perfectly fine."

Browse freely — sign in when you're ready to open a ticket and prove your skills.