Design a URL Shortener
bit.ly at scale: turn long URLs into short codes, redirect in milliseconds from anywhere, count the clicks.
45 questions on this site are reported in Microsoft software engineer interviews. Each has a full reference design (requirements, back-of-envelope numbers, components, user flows and deep dives with interviewer follow-ups). Each one can be walked through turn by turn and then sat as a mock. Patterns covered: key-generation, caching, cdn, analytics, real-time, websockets, fan-out, chat, transcoding, adaptive-bitrate, pipelines, storage, multi-channel, idempotency, rate-limiting, priority-queues, crdt, operational-transform, conflict-resolution, streaming, tool-calling, context-management, prompt-caching, consistent-hashing, eviction, replication, hot-keys, frontier, politeness, dedupe, scheduling, distributed-queues, chunking, sync, object-storage, media-pipeline, counters, ttl, persistent-connections, store-and-forward, end-to-end-encryption, delivery-receipts, push, sorted-sets, ranking, sharding, time-windows, anti-cheat, quorum-replication, gossip, lsm-tree, id-generation, clocks, leases, bit-layout, k-sortable, sandboxing, job-queue, untrusted-code, contests, autoscaling, append-only-log, partitioning, consumer-groups, exactly-once, time-series, compression, cardinality, downsampling, alerting, workflow-orchestration, polling, webhooks, multi-tenancy, contention, compare-and-set, durable-timers, bidding, broadcast, pub-sub, sse, sampling, moderation, webrtc, sfu, real-time-media, congestion-control, multi-region, inverted-index, scatter-gather, tail-latency, search, smtp-ingress, spam-filtering, per-user-sharding, consensus, fencing-tokens, leader-election, watches, erasure-coding, range-partitioning, durability, strong-consistency, recurrence, time-zones, interval-search, deployment, canary, reconciliation, rollback, blast-radius, log-aggregation, tiered-storage, backpressure, live-video, low-latency, request-coalescing, adaptive-scheduling, change-detection, range-queries, multiplayer, last-writer-wins, fractional-indexing, checkpoints, load-balancing, networking, health-checks, control-plane, rag, vector-search, hybrid-search, permissions, anycast, tiered-cache, cache-invalidation, api-gateway, authentication, quotas, graph, in-memory, consistency, batch, auctions, budget-pacing, git, quorum, content-addressing, thundering-herd, udp, game-servers, gaming, clustering, ingestion, edge-caching, deduplication, experimentation, hashing, statistics, stream-processing, latency-budget, cancellation, prefix-caching, context-assembly, code-completion, expiry, privacy, abuse, bin-packing, failure-detection, actors, presence, wide-column.
Run an AI mock Microsoft interview →One of these questions, run as a live round in that style, with a debrief at the end.
Attribution comes from public interview guides and candidate reports, not from Microsoft. It indicates where a question has been asked, nothing more.
bit.ly at scale: turn long URLs into short codes, redirect in milliseconds from anywhere, count the clicks.
Real-time team messaging: channels, DMs, presence, history and search for millions of concurrent users.
Upload, transcode, and stream video to a billion viewers: a processing pipeline on one side, a CDN problem on the other.
Deliver push, email, SMS and in-app notifications to hundreds of millions of users: the right channel, once, on time, and never at 3 a.m.
Real-time collaborative editing: many cursors in one document, every keystroke converging to the same text, offline edits merged on reconnect.
An AI chat assistant for 100 M weekly users whose streamed answers survive dropped connections, call tools mid-answer, and share scarce GPUs across tiers.
A Redis-like cache as a service: hundreds of nodes, terabytes of memory, sub-millisecond gets, and a cluster that survives losing a machine mid-request.
Fetch billions of pages a month politely, discover new links, skip duplicates, and keep the copy fresh without getting the crawler banned.
Keep a folder identical on every device: upload huge files in resumable chunks, push only what changed, and reconcile two machines that both edited the same file offline.
Upload photos, publish posts and stories, and load a feed of them for 500 M daily users, with every image served from a CDN in milliseconds.
Deliver 50 billion end-to-end encrypted messages a day to phones that are often offline, with sent, delivered and read ticks, and a server that cannot read any of it.
Rank 300 M players of a mobile game in real time: the global top 100, your exact rank among millions, your friends, and daily, weekly and season boards that reset on time.
A Dynamo-style store that keeps 10 billion keys on dozens of machines, survives node and rack failures, and lets each caller trade consistency for latency with N, R and W.
Hand out a million 64-bit ids a second across many hosts and regions, never twice, roughly in time order, with no central bottleneck and no trust in the wall clock.
Run untrusted code from strangers against hidden tests in a dozen languages, return a fair verdict in seconds, and survive 50,000 people submitting in the last minutes of a contest.
A Kafka-style log that ingests a million messages a second, keeps them in order per key, replicates them so no acknowledged message is lost, and lets many consumer groups read at their own pace.
Ingest 10 million samples a second from 100,000 hosts, keep them queryable for a year at shrinking resolution, draw dashboards in under a second, and page the right person within a minute.
Connect thousands of third-party apps: watch ten million triggers by polling or webhook, and run each new event through multi-step workflows on someone else’s APIs.
Run 50 million live eBay-style auctions: order every bid strictly per auction, push the price to watchers live, and close each auction exactly once.
Comments and reactions on live video that reach viewers within two seconds, at 50 M concurrent viewers and 5 M on one stream.
Real-time audio, video and screen share for 2 to 1,000 people per meeting, 300 M participants a day, under 150 ms mouth to ear.
Search 50 billion pages at 100 k queries a second: the ten best results with snippets in under 200 ms, and news within minutes.
Receive, filter, store and search email for 1.5 billion users: 200 billion inbound messages a day, mostly spam, kept for 20 years.
A Chubby-style lock service for 50 k processes: leases, leader election, fencing tokens and watched config, never letting two holders act at once.
An S3-like store for objects from bytes to terabytes, with eleven nines of durability and strong read-after-write consistency at exabyte scale.
Recurring events, invitations, free/busy and reminders for 500 million users, correct in every time zone and synced to every device within seconds.
Build each merge once into a signed artifact, roll it out in stages to 50,000 hosts in 10 regions, and roll back automatically on regression.
Collect 10 million log lines a second from 100,000 hosts, make them searchable within seconds, stream them live, and keep a year affordably.
Ingest 100 k live broadcasts, transcode them in real time, and deliver each about three seconds behind live, to three viewers or 500 k.
Track 500 M products' price history and alert 50 M users when a price drops below their target, in time to buy.
500 k design files open at once, some with 200 people: objects converge live, cursors stream, and 300 MB files open in seconds.
Spread 5 M requests a second over 50 k backends, terminate TLS, route by host and path, survive losing any balancer or data centre.
An assistant that answers employees’ questions from their company’s documents, with citations, only from what each user may open, minutes after edits.
A multi-tenant CDN for 30 M customer domains: 300 PoPs, 50 M requests a second served mostly from cache, and global purges in seconds.
One front door for public and partner APIs: authenticate, limit and route 1 M requests a second to 300 services, adding under 10 ms.
LinkedIn’s connections for 1 B members: invitations, follows, a 1st/2nd/3rd badge on 200 k profile views a second, and daily People You May Know.
Pick the best of 10 M active ads for 5 M requests a second in under 100 ms, within every campaign’s targeting, budget and frequency caps.
Host 400 M git repositories on replicated file servers, serve 100 k fetches a second, and run pull requests, forks and webhooks on top.
Battle royale for 3 M concurrent players: 100-player matches on authoritative 30 Hz servers, fair hits, warm fleets and launch-day surges.
Collect 2 M articles a day from 50,000 publishers, group them into stories, rank them per edition, and serve 300 M daily readers.
Run 500 experiments at once on 300 M users: sticky variants in microseconds, exposure logging, and confidence intervals teams can trust.
Inline AI code suggestions for 10 M developers, shown within 300 ms of a pause in typing, when most requests are never used.
Store and serve 10 M text pastes a day behind unguessable links: expiry that is never late, burn after reading, and abuse takedown.
Place 300,000 containers on 10,000 machines from declared desired state, keep them running through failures, and give every service a stable address.
Community chat and voice: servers with a million members, years of history, roles and presence, for 20 M concurrent users.
45–60 minutes, usually one design plus follow-ups, with the level of abstraction set by the role.
Skipping the boring version. Get a simple end-to-end design on the board early, then improve it.
From public interview guides and candidate reports, and Microsoft’s own interview guidance where it publishes any. Not endorsed by Microsoft. Formats change; treat it as a prior, not a promise.
Large-company loops run 45 to 60 minutes, expect numbers, and spend most of the time on deep dives. Walk through a question to see how a strong candidate paces the hour, sit the same question as a mock until you can produce the requirements, the estimates and the design without looking, then read the interview framework guide for how to structure the hour. The other questions on the site teach patterns that show up in Microsoft interviews under different names.
Questions reported in Microsoft system design interviews include URL Shortener, Slack, YouTube, Notification System, Google Docs, ChatGPT, Distributed Cache and Web Crawler, among 45 in total. Between them they test key generation, caching, cdn, analytics, real time and websockets. The reports come from public interview guides and candidate accounts, not from Microsoft, so practise the patterns rather than memorising one list.
45–60 minutes, usually one design plus follow-ups, with the level of abstraction set by the role.
Reports say the Microsoft round weighs 4 things. 1. Requirements and scoping before design. 2. Reliability, versioning and backwards compatibility. 3. Concrete component choices with reasons. 4. Communication: a design someone else could implement from your description. Skipping the boring version. Get a simple end-to-end design on the board early, then improve it.
Practise the questions reported there out loud, under a 45-minute clock: requirements with numbers first, then estimates, a high-level design, and deep dives into the two or three hardest parts. Start with URL Shortener: watch a strong candidate answer it turn by turn, then sit it yourself. Then cover the patterns the round leans on (key generation, caching, cdn and analytics) with one more question each.