Loading…
Loading…
Practice catalog
Every problem ships with a checklist of what strong answers cover, a stage-by-stage workspace, and a debrief that points you to the exact concept to study next.
Design a URL shortening service like Bit.ly that takes long URLs and creates short, unique aliases. Users should be able to create short URLs, be redirected when visiting them, and optionally track click analytics. The system should handle millions of URLs and redirect requests with minimal latency.
Design a rate limiting system that controls the rate of requests a client can send to an API. The rate limiter should support different rate limiting algorithms, work in a distributed environment, and provide clear feedback to clients when they are throttled. Consider how this would work as both a standalone service and as middleware.
Design a real-time chat application like WhatsApp or Messenger that supports 1:1 and group messaging (up to 100 participants). Users should be able to send text and media messages, receive messages in real time when online, and retrieve undelivered messages when they come back online. The system must handle billions of users with low-latency delivery and guaranteed message durability.
Design a social media news feed system like Facebook's News Feed or Twitter's Home Timeline. When a user opens the app, they see a personalized feed of posts from people and pages they follow, ranked by relevance. The system must handle billions of users, hundreds of millions of posts per day, and deliver a fresh feed within seconds. The key design decision is how to generate the feed: pre-compute it on write (fan-out-on-write) or assemble it on read (fan-out-on-read).
Design a notification system that can send notifications to users across multiple channels — push notifications (iOS/Android), SMS, and email. The system must handle billions of notifications per day, support user preferences and opt-outs, de-duplicate notifications, and ensure reliable delivery with prioritization. Upstream services (e.g., orders, social, marketing) publish notification events; the notification service handles routing, templating, channel selection, and delivery.
Design a search autocomplete (typeahead) system like Google Search suggestions. As a user types each character, the system returns the top 5-10 most relevant search suggestions within 100ms. The system must handle billions of queries per day, rank suggestions by popularity and personalization, and update its suggestion corpus as new queries emerge.
Design a ticket booking system like Ticketmaster or BookMyShow for live events (concerts, sports). Users browse events, select seats from a venue map, and complete payment — all while thousands of other users compete for the same seats. The system must prevent double-booking (two users paying for the same seat), handle massive traffic surges when popular events go on sale, and provide a fair booking experience under extreme contention.
Design the inference layer for a B2B platform whose customers embed LLM features in their apps. Each tenant sends millions of prompt requests per day across multiple foundation-model providers. The gateway must route by tenant policy, cache responses safely, fall back across providers on outage, enforce per-tenant cost and rate budgets, stream tokens end-to-end, and keep an auditable log of every call. Cost runaway, provider outages, and noisy-neighbor tenants are the day-1 production failure modes.
Design the webhook layer for a B2B platform (think Stripe events, GitHub webhooks). When something happens internally (charge succeeded, PR opened), an event must be delivered to every customer endpoint subscribed to that event type — durably, signed, and with retries on failure. Customers get a dashboard to inspect delivery attempts and replay failed events. Endpoints fail constantly: timeouts, 5xx, slow consumers, customers down for hours. The hard problems are slow-customer isolation, retry-storm protection, and dashboard replay without overwhelming a recovering customer.