Design Discord (Voice Chat with Low Latency) - System Design

People hear “build Discord voice” and reach for the same WebRTC tutorial they would use for a video call: two peers, an SDP exchange, media flows, done. Discord voice is a different animal from Zoom, and the differences are what make the design interesting. There is no “meeting” you schedule and join. There is a persistent voice channel sitting inside a server, always there, and users drop in and out of it the way you walk into a room. The latency budget is tighter - voice-only, interactive, gaming-adjacent, so the target is sub-100ms mouth-to-ear, not Zoom’s 200ms. And the pathological case is not a 1000-person webinar with one speaker; it is a hot channel with 10,000+ people who can all unmute and talk, a community stage or a raid, where the fan-out is genuinely many-to-many. ...

29 min

Design Insurance Claims Processing - System Design

“Design insurance claims” sounds like a form with a Submit button. A customer uploads a photo of their dented car, someone looks at it, money gets paid. The interviewer lets that stand until they ask the question that breaks it: this is not a request-response system, it is a long-running, human-in-the-loop workflow that must be fully auditable years later. A single claim lives for days or weeks. It is touched by a customer, an ML model, a fraud engine, one or more human adjusters, maybe a surveyor and a hospital, and finally a payment system. Any of them can send it backward - ask for more documents, flag fraud, dispute the estimate. And every single one of those touches is a regulated record: when a claim is denied, the regulator (and possibly a court) can demand the exact inputs, model version, and human decision that produced that outcome, reproducible on demand. ...

33 min

Design Loan Disbursal Platform (FinTech) - System Design

A loan disbursal platform looks like a form plus a yes/no, and interviewers love it because it is not. The “form” fans out to a half-dozen external systems you do not control - credit bureaus, KYC/identity providers, bank account verification, a fraud graph, an ML risk model - some of which are slow, some flaky, some rate-limited, all of which cost money per call. The “yes/no” is a regulated underwriting decision that must be explainable, reproducible years later, and never made twice on the same application. And the payoff at the end is disbursal: real money leaving your account to a customer’s bank, over a rail you cannot roll back. A duplicate disbursal is money gone. ...

33 min

Design Aadhaar / National Identity Database - System Design

“Store identity for everyone and let them prove who they are” sounds like a users table with a photo column. Then you look at the numbers and the physics of biometrics, and it stops being CRUD. You are holding fingerprints, irises, and demographics for 1.4 billion people. Every single new enrollment has to be checked against the entire existing population to guarantee that this human does not already hold an identity under another name - a 1:N biometric match against 1.4 billion records, not a key lookup. And once enrolled, a person must be able to prove their identity at a ration shop, a bank, or a SIM counter in under two seconds, 50 million times a day, while a regulator watches every byte of how you store and move the most sensitive data a state can hold about a person. ...

34 min

Design Twitch (Live Streaming Platform) - System Design

Twitch is not a video problem with a chat bolted on. It is a real-time interaction problem that happens to carry video. That is the thing that trips people in the interview: they reach for the YouTube answer (transcode once, serve immutable bytes from the edge forever) or the live-sports answer (one pro feed, fan it to millions through a CDN) and both are wrong in the way that matters. Twitch has two features neither of those has. First, the content comes from millions of amateur streamers at once, each a separate live ingest with its own transcode, most of them watched by twelve people and a handful watched by a million - a brutal long tail with no pre-encode and no warning about which stream goes viral. Second, the whole point is the loop: a viewer types in chat, the streamer reads it on screen two seconds later and reacts, and the viewer sees that reaction. If the video is 30 seconds behind, that loop is dead and you have built YouTube. So the latency target is not “feels live,” it is sub-5-second glass-to-glass, tight enough that chat and video stay in sync. ...

25 min

Design WhatsApp Status (24-hour Stories) - System Design

WhatsApp Status looks like Instagram Stories with a different logo, and if you design it like Stories you will get most of it right and miss the one thing that makes it hard. Stories is a public-ish follow graph where the server can read everything. Status is end-to-end encrypted over a bidirectional phone-contacts graph with per-contact privacy rules, and the server is never allowed to see the pixels. Those two facts - the server cannot read the media, and “who can see this” is a function of two address books agreeing - reshape the entire fan-out, and that is where the interview lives. ...

30 min

Design Comment Moderation / Toxicity Filter - System Design

Content moderation looks like a machine learning problem and ends up being a systems problem. The model is the easy part - a toxicity classifier is a solved research problem you can download. The hard part is running it on 1 billion comments a day, in the write path, inside a 100ms budget, while attackers mutate their phrasing faster than you can retrain. If scoring a comment takes 300ms, every comment post gets 300ms slower and your throughput falls off a cliff. If you put the model behind the write and score async, abusive comments go live before you catch them. And if your filter is static, the spammers route around it by lunchtime: f r e e m0n3y, zero-width characters between letters, homoglyphs, image-text, the same slur spelled nine ways. ...

28 min

Design Live Cricket Score / Sports Updates - System Design

Everyone starts this problem by drawing a box labeled “score database” and an arrow to a phone. The interviewer nods and then tells you it is the second innings of an IPL final, the match is going to the last over, and 100 million people have the app open at the same moment refreshing to see whether the next ball is a six or a wicket. Now the box-and-arrow picture is useless. A single ball event has to reach 100 million screens in under a second, and it has to reach them in the right order, and if the third umpire reverses a wicket thirty seconds later every one of those 100 million screens has to correct itself, and when a fan opens the app in the 15th over they need the full scorecard of everything that already happened. This is not a database read problem. It is a real-time fan-out problem with a durable, correctable event log underneath it - and the “live score” a fan sees is just the latest projection of that log pushed to their screen. ...

23 min

Design Live Sports Streaming (Hotstar / IPL) - System Design

Live sports is the hardest shape of video there is, and it is hard for a reason that is the exact opposite of YouTube. On a VOD platform you do the expensive work (transcoding) once, offline, days before anyone watches, and the hard part is serving immutable bytes cheaply forever. On live, the match is happening right now, there is no pre-encode, the stream has to be transcoded and packaged and pushed to the edge in the same few seconds the ball is being bowled, and every one of 50 million viewers is watching the same 6 seconds of video at the same wall-clock moment. There is no long tail to smooth the load. The whole audience arrives when the toss happens, surges when a wicket falls, and all 50M of them scream at the CDN within the same 2-second window when a six is hit. And they will notice if the stream is 30 seconds behind, because their neighbour on a different app (or just the apartment next door) will cheer first and spoil it. ...

33 min

Design Mobile Recharge / Bill Payment - System Design

A user opens the app, taps “Electricity”, types a consumer number, and a second later sees “Bill: 2,340, due Nov 20”. They pay, and a few seconds later a receipt lands with a reference number the electricity board will honour. That is the product. It looks like a thin shopping cart over a payment gateway, and the interviewer will let you believe that for about a minute before pointing at the thing that actually makes this hard: there is no single “bill API”. There are 1000+ billers - every state electricity board, every water utility, every gas company, every telecom - each with its own protocol, its own uptime, its own idea of what “fetch bill” means, and its own habit of going down on the first of the month when everyone pays at once. ...

25 min

Design Password Manager (1Password / LastPass) - System Design

A password manager looks like a trivial CRUD app. Store some login records, sync them across the user’s phone and laptop, auto-fill them into websites. One table, a REST API, done. The interviewer lets you believe that for about thirty seconds, then asks the one question that reorganizes the entire system: can your servers read the passwords they store? The correct answer - the only answer a serious password manager can give - is no. Not “we encrypt at rest with a key we hold.” No. The server must be structurally incapable of reading a single stored credential, even if the entire database is stolen, even if a rogue employee has root, even if you are legally compelled to hand over everything. ...

28 min

Design Single Sign-On (SSO / OAuth Provider) - System Design

Single Sign-On sounds like a login screen. It is not. It is a token factory that a hundred applications trust, sitting at the center of an organization, deciding on every single request across every single app whether the person holding a bearer string is who they claim to be and whether they are allowed to do the thing they are asking to do. You log in once, at one place, and then Gmail, Docs, Drive, Photos, YouTube, and three hundred internal tools all believe you without ever seeing your password. The magic is not the login. The magic is that one central authority mints credentials the other apps can verify, and can un-mint them the instant something goes wrong. ...

24 min

Design UPI / PhonePe (Real-Time Payments) - System Design

“Scan a QR, money leaves your HDFC account and lands in a shopkeeper’s SBI account in three seconds” sounds like one API call. It is not. HDFC and SBI are two different companies with two different databases that will never share a transaction. There is no UPDATE that touches both. In between sits a switch (NPCI) that neither holds the money nor owns either account, yet has to guarantee that the payer’s account is debited exactly when and only when the payee’s account is credited - across two banks, over a network, inside a 5-second timer, ten billion times a month, and it has to be provably correct afterwards when the regulator asks. The one thing you cannot do is the obvious thing: a single distributed transaction that locks both banks. Banks will not give you a lock. So the entire design is about moving money atomically-in-effect across systems that refuse to coordinate. ...

39 min

Design a CAPTCHA Service - System Design

Everyone pictures a CAPTCHA as a picture of squiggly text. “Render some distorted letters, ask the user to type them, check the string, done.” Then the interviewer adds the constraints that turn it into a real system: it is not one page, it is a service in front of every signup, login, password reset, and checkout across thousands of sites, so it must answer in the tens of milliseconds before the form submits; it is not thousands of solves, it is millions of challenges per second; the thing it is fighting adapts - the moment you ship a challenge, someone builds a solver, a farm of humans, or an ML model to beat it, so a static challenge is dead on arrival; and the verdict it returns crosses a trust boundary - the browser is hostile, so a naive “you passed” flag is trivially forged and replayed. The whole problem is adversarial by construction. ...

37 min

Design Reverse Image Search (Google Images) - System Design

Reverse image search looks like a search problem, and it is - but not the kind you get from an inverted index of words. A user hands you a picture, not a query string, and asks “where does this appear, and what looks like it.” There are no keywords to match. The only thing you have is pixels, and pixels are the wrong unit: the same photo re-saved as a JPEG, cropped by 5%, watermarked, or scaled to a thumbnail is byte-for-byte a completely different file, yet to a human it is obviously “the same image.” So the core of the problem is not string matching or even byte matching - it is turning an image into a representation where visual similarity becomes geometric closeness, and then finding the closest points to a query among 100 billion of them, in under a second. ...

28 min

Design Shazam (Audio Fingerprinting) - System Design

You hold your phone up to a speaker in a loud cafe, capture five seconds of a song you half-recognize, and a moment later the screen names the track, the artist, and the exact timestamp you were listening to. There is background chatter, the audio is compressed by a cheap phone mic, the recording started somewhere in the middle of the song, and the match is drawn from a catalog of over 100 million tracks. And it comes back in under three seconds. ...

27 min

Design a Distributed Lock Service (ZooKeeper / etcd) - System Design

There is a small category of infrastructure that is boring on the surface and terrifying underneath: the thing that every other service leans on to agree with itself. A distributed lock service is that thing. It answers questions that sound trivial and are not: who is the current leader of this shard, which one of these three replicas is allowed to write right now, has the config changed, is node 4,812 still alive. Every microservice in a 10,000-node cluster calls it, often on a hot path, and if it hands back a wrong answer even once - two leaders, two lock holders, a stale config - you get split brain and data corruption that surfaces days later. ...

27 min

Design Google Translate - System Design

Google Translate looks like a text box: you type “hello,” you get “hola,” done. That intuition survives one short sentence. The moment you ask “hello” to become fluent Japanese, or you paste a 40-page PDF, or two people hold a live spoken conversation across a language barrier, the box turns into a distributed system whose real job is to run large neural machine translation (NMT) models on GPUs/TPUs at sub-second latency, across 100+ languages meaning 10,000+ possible language pairs, while translating billions of words a day - and to do that without lighting a datacenter’s worth of accelerators on fire. The interesting part is not “map word A to word B.” It is: a stateless serving tier that turns arbitrary input (a phrase, a whole document, a web page’s DOM, a stream of speech) into segments, batches those segments across users to keep expensive accelerators busy, routes each segment to the right model for its language pair, caches the enormous repeat-translation traffic so most requests never touch a GPU, and streams partial results back fast enough that a conversation feels live. Let me build it properly. ...

32 min

Design S3 (Object Storage) - System Design

An object store looks like a hash map with two methods: PUT(key, bytes) and GET(key) -> bytes. That framing is exactly why it is hard. A hash map lives in one process’s memory; this one holds trillions of objects and exabytes of bytes across hundreds of thousands of disks in dozens of datacenters, and promises that once a PUT returns 200 OK the bytes will still be there in a thousand years - eleven nines of durability, meaning if you store ten million objects you expect to lose one every ten thousand years. The naive version is a directory on a big disk behind an HTTP server, and it dies the first time a disk fails, the first time one key gets a billion reads, and the first time the index of keys outgrows a single machine. Everything real about S3 is the machinery that keeps a dumb key-value interface alive when the disk will fail, the datacenter will burn, and the keyspace will not fit anywhere. ...

31 min

Design Apple Find My / Google Find My Device - System Design

Find My looks like a location-tracking problem and it is, but the interesting half is a paradox: you must locate a device that is offline - powered-off phone, an AirTag with no radio but Bluetooth, a laptop in a stranger’s bag - using a network of a billion other people’s devices, while guaranteeing that the company running the network can never see where any device is, and that the strangers doing the finding can never be identified or turned into a tracking tool. An online device reporting its own GPS is the easy case. The hard case is: a lost AirTag has no GPS, no cellular, no wifi - it can only whisper over Bluetooth. Someone else’s iPhone walks past, hears the whisper, knows its own location, and has to get that location back to the owner - without the passer-by learning what they found, without Apple learning who found what or where, and without a stalker being able to slip an AirTag into your bag and watch you on a map. ...

30 min