Design a URL Shortener
bit.ly at scale: turn long URLs into short codes, redirect in milliseconds from anywhere, count the clicks.
62 questions on this site are reported in Amazon 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, consistency, idempotency, ledger, fintech, transcoding, adaptive-bitrate, pipelines, storage, geospatial, matching, streaming, marketplace, multi-channel, rate-limiting, priority-queues, gpu-batching, scheduling, kv-cache, tool-calling, context-management, prompt-caching, consistent-hashing, eviction, replication, hot-keys, frontier, politeness, dedupe, distributed-queues, algorithms, counters, redis, edge, chunking, sync, object-storage, conflict-resolution, inventory, reservations, locking, queueing, thundering-herd, tries, ranking, search, stream-processing, windowing, exactly-once, olap, leases, queues, fault-tolerance, order-book, determinism, event-sourcing, low-latency, fairness, media-pipeline, ttl, persistent-connections, store-and-forward, end-to-end-encryption, delivery-receipts, push, proactive-caching, steering, resilience, geospatial-index, change-data-capture, aggregation, sorted-sets, sharding, time-windows, anti-cheat, quorum-replication, gossip, lsm-tree, id-generation, clocks, bit-layout, k-sortable, sandboxing, job-queue, untrusted-code, contests, autoscaling, availability-search, double-booking, holds, calendar-sync, append-only-log, partitioning, consumer-groups, time-series, compression, cardinality, downsampling, alerting, geo-sharding, recommendations, bloom-filters, match-detection, write-heavy, comment-trees, voting, listings, state-machine, dispatch, eta-prediction, location-tracking, workflow-orchestration, durable-timers, contention, compare-and-set, bidding, broadcast, pub-sub, sse, sampling, moderation, heavy-hitters, count-min-sketch, sliding-windows, webrtc, sfu, real-time-media, congestion-control, multi-region, inverted-index, scatter-gather, tail-latency, prefetching, licensing, offline, counting, playlists, smtp-ingress, spam-filtering, per-user-sharding, shopping-cart, saga, vector-search, feature-store, 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, multi-tenancy, live-video, request-coalescing, adaptive-scheduling, change-detection, range-queries, async-pipeline, spatial-matching, leaderboards, privacy, load-balancing, networking, health-checks, control-plane, anycast, tiered-cache, cache-invalidation, api-gateway, authentication, quotas, auctions, budget-pacing, git, quorum, content-addressing, fraud, short-video, prefetch, session-ranking, exploration, expiry, abuse, random-walks, visual-search, deduplication, image-serving, market-data, order-management, external-inventory, bin-packing, failure-detection.
Run an AI mock Amazon 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 Amazon. 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.
Accept card payments for an e-commerce platform, move money correctly exactly once, and be able to prove it.
Upload, transcode, and stream video to a billion viewers: a processing pipeline on one side, a CDN problem on the other.
Match riders with nearby drivers in seconds, track trips live, and price them, for millions of concurrent users worldwide.
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.
Serve a large language model behind an API: queue the requests, batch them onto scarce GPUs, stream tokens back, and keep every accelerator busy without blowing the latency budget.
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.
A distributed service that decides, in under a millisecond, whether a request from a client is allowed under its quota.
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.
Sell 60 000 seats in ten minutes to a million people at once: hold a seat while someone pays, never sell it twice, and keep the site up when demand is a hundred times supply.
Suggest the top ten completions after every keystroke, in under fifty milliseconds, from what the world searched for in the last hour, without suggesting anything that gets you in the newspaper.
Count a million ad clicks a second, show advertisers a dashboard that is seconds behind, stop a campaign the moment its budget runs out, and be exactly right when the invoice is cut.
Run millions of cron jobs and one-off tasks on time across a fleet, exactly once each, and keep going when a worker dies halfway through one.
Match buy and sell orders in microseconds, in a strict and provable order, never lose a fill, and stay correct when the matching engine dies mid-trade.
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.
Stream a fixed catalog to 40 M people at once, 200 Tbps at peak, starting in under two seconds, from cache servers placed inside the viewers’ own internet providers.
Find the best places near you, filtered by what is open now, from 200 M businesses, in under 200 ms, and keep ratings honest as reviews arrive.
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.
Search 7 M listings by place, dates and price, book a stay without ever selling the same night twice, and keep calendars in sync with hosts’ other platforms.
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.
Show each person a deck of nearby profiles that fit both people’s preferences, never repeat one, take 2 billion swipes a day, and announce a match the instant two people like each other.
Serve communities of posts with deeply nested comment threads, take tens of thousands of votes a second, rank by hot and best, and keep a 50,000-comment thread fast while it is still growing.
Take a food order, get a restaurant to cook it and a courier to arrive just as it is ready, and keep three parties in sync across millions of orders a day.
A managed workflow engine that runs 200 M state-machine executions a day, some lasting a year, applying every transition exactly once.
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.
Rank the top 1,000 videos by views over the last minute, hour, day and all time, from a million views a second.
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.
Stream 100 M tracks to 600 M listeners with sound in 200 ms, offline downloads, regional licensing, and every play counted for royalties.
Receive, filter, store and search email for 1.5 billion users: 200 billion inbound messages a day, mostly spam, kept for 20 years.
A 500 M-product marketplace: product pages at 100 k views/s, carts that never lose an item, and Prime Day checkout without overselling.
The “recommended for you” video home feed: 50 personalised videos picked from billions for 500 M daily users in under 200 ms.
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.
Record runs and rides offline, process each upload into a map, stats and segment efforts, and rank them for 100 M athletes.
Spread 5 M requests a second over 50 k backends, terminate TLS, route by host and path, survive losing any balancer or data centre.
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.
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.
80 M users paying friends instantly: 15 M transfers a day on a sharded double-entry ledger, funded and cashed out over slow bank rails.
A full-screen feed of short videos for 1 B daily users, where the next clip starts instantly and every swipe reshapes what comes next.
Allow, block or challenge 10,000 card payments a second in under 100 ms, then learn from chargebacks that arrive months later.
Store and serve 10 M text pastes a day behind unguessable links: expiry that is never late, burn after reading, and abuse takedown.
Save images to boards, browse a personalised grid and search by picture: 100 M daily users, 5 B distinct images behind 100 B saves.
A retail brokerage: live prices to 3 M phones, 20 k orders a second at the open, every share and cent exact.
Answer 50 M searches a day from 20 slow, metered suppliers through a fare cache, then book seats you do not own, exactly once.
Place 300,000 containers on 10,000 machines from declared desired state, keep them running through failures, and give every service a stable address.
45–60 minutes, with Leadership Principles woven through the technical discussion rather than kept in a separate round.
Hedging. Naming three options and picking none reads as indecision here more than anywhere else; choose, justify, and say what would change your mind.
From public interview guides and candidate reports, and Amazon’s own interview guidance where it publishes any. Not endorsed by Amazon. 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 Amazon interviews under different names.
Questions reported in Amazon system design interviews include URL Shortener, Slack, Payment System, YouTube, Uber, Notification System, LLM Inference Service and ChatGPT, among 62 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 Amazon, so practise the patterns rather than memorising one list.
45–60 minutes, with Leadership Principles woven through the technical discussion rather than kept in a separate round.
Reports say the Amazon round weighs 4 things. 1. Customer obsession: starting from the user experience and working back. 2. Dive deep: explaining the internals of anything you put on the board. 3. Bias for action: making a decision and moving, rather than enumerating options. 4. Operational ownership: monitoring, on-call, what breaks at 3 a.m.. Hedging. Naming three options and picking none reads as indecision here more than anywhere else; choose, justify, and say what would change your mind.
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.