Worked system design interview problems
How a strong candidate answers each one: requirements, the estimate, the API, a model design, deep dives and the follow-up questions interviewers ask.
- URL shortener (Mid): Turn long links into short codes and redirect people fast. The system is read-heavy: about 100 redirects for every new link. The real questions are how to generate unique codes and how to keep popular redirects in a cache (a fast in-memory copy of the data).
- Chat app (Mid): One-to-one and small-group chat for 50 million daily users, with delivery and read receipts. The interesting parts are persistent connections, keeping messages in order within each conversation, and getting messages to people who were offline.
- Notification service (Senior): A shared service that sends email, SMS and push for every team. It retries failures and never sends the same notification twice. The core ideas are a queue between accepting and sending, idempotency keys, backoff and a dead-letter queue.
- Rate limiter (Senior): A distributed rate limiter shared by many gateway servers, at about 100,000 requests a second. The questions are which algorithm to use, how many servers can update one counter without races (two updates overwriting each other), and what happens when the limiter itself fails.
- UPI-style payments switch (Senior): A generic UPI-style switch that routes payments between banks using a virtual payment address (VPA, such as ravi@okbank). It handles about 100 million payments a day, with festival peaks. The hard parts are idempotency, the unknown outcome after a timeout, and reconciliation (matching our records against each bank's records).
- Flash-sale checkout (Senior): Checkout for a festival flash sale: five million shoppers in the first minute, and a few thousand units. The design turns away almost everyone cheaply and fairly. It makes overselling impossible with an atomic gate in memory plus a conditional update in the database.
- Design a social news feed (Senior): A home feed of recent posts from the accounts you follow, served in well under 200 ms. The core decision is when to copy a post into followers' feeds: when it is written, or when the feed is read. The hard case is an account with millions of followers.
- Design live streaming for a cricket final (Senior): Stream one live match to tens of millions of viewers at once, on patchy mobile networks. The hard parts are delivery capacity (several CDNs and an origin shield), how segment length trades delay against smooth playback, and counting viewers without one overloaded database row.
- Design ride-hailing matching (Senior): Match a rider to a nearby driver in seconds, while tens of thousands of drivers send their location. The core pieces are a geo index built for fast writes, a protocol for offering rides to drivers, and a trip state machine that never assigns one driver twice.
- Design a Tatkal-style ticket booking rush (Senior): At 10:00 sharp, booking opens and about a million people try to book a few lakh seats in minutes. The design rests on a fair waiting room, seat holds that expire, consistent seat allocation per train, and a payment window that always closes before the hold expires.
- Design 10-minute grocery dispatch (Senior): From "can you deliver here?" to a delivery partner leaving the dark store with the bag. Serviceability, stock reservation per store, partner assignment and deadline timers that survive restarts all have to fit inside a ten-minute promise.
- Design search autocomplete (Mid): Search suggestions for a shopping app, shown before the user types the next letter. The answer is a prefix index that already stores the top 10 suggestions for every prefix. It is rebuilt offline from search logs, kept in memory and cached at the CDN.
- Design an AI support assistant (RAG) (Senior): A help bot that answers from SwiftKart's help articles and the customer's own orders, with citations, and hands off to a human when unsure. The core is ingestion, retrieval that respects permissions, an LLM gateway with fallbacks, and evals that every change must pass.