1. Design a URL Shortener
Create short links, resolve them quickly and handle expiry without sending users to the wrong destination.
Start with a template. Work through each step. Ask Coach when you need a second opinion.
Company tags are community-reported. Counts on cards show how many people reported that design.
Create short links, resolve them quickly and handle expiry without sending users to the wrong destination.
Enforce tenant quotas across servers while making burst behavior and outage policy explicit.
Partition cached data, survive node loss and keep cache misses from overwhelming the source of truth.
Build a paginated feed that handles high-fan-out authors, fresh posts and visibility changes.
A read-heavy service sends every request to a database that is slower and more expensive per read than memory, and the same few rows are asked for over and over.
Building a timeline when someone opens the app means reading from everyone they follow and merging — slow, and slowest for the most active users. Building it when someone posts makes reads a single lookup, but one post by an account with fifty million followers becomes fifty million writes.
A limit enforced per server is not a limit: ten servers each allowing a hundred requests a minute allow a thousand. And a counter per fixed window lets twice the limit through across a window boundary.
Finding the nearby members of a set that is constantly moving. A table scan with a distance function is hopeless at any scale, and a stale position is worse than none — it sends a car to someone who left ten minutes ago.
Google Calendar-style events with recurrence, RSVPs and on-time reminders, using CDC for change notifications and a delay queue for reminders.
The K most-viewed videos for the last hour, day, month and all time from 700,000 views a second, exactly and in milliseconds.
Run strangers' code safely in single-use microVMs, return verdicts within 5 seconds, and rank 100,000 contestants live.
Price a trip, match a rider to a nearby driver who has ten seconds to accept, and never give one driver two rides.
Show what 10,000 small warehouses can deliver within the hour in under 100 ms, and take multi-item orders without ever selling a unit twice.
Photos and videos for 500 million daily users: presigned multipart uploads, a processing pipeline, CloudFront and a hybrid fan-out feed.
Collect from 20,000 publishers by push, polls and crawls, file each article once into feeds by region and category, and serve a billion pages a day from the edge.
Search a billion posts a day by keyword, newest or most liked first, with an inverted index you build yourself.
Stacks of nearby people in under 300 ms, 2 billion swipes a day, and a match never missed even when both like at once.
Record runs and rides on the phone without signal, upload each once, show them to friends and rank athletes by week, month and year.
Sell 10,000 units to a million people at noon with a lottery waiting room, a Redis gate before an Aurora ledger and holds that expire.
Serve a product page a million times a second: a cheap query, replicas, Redis and the edge, with hot keys, stampedes and invalidation handled.
An in-memory data store like Redis, from one event loop to Redis Cluster to a durable platform.
Radius, k-nearest and map-box search over places that rarely move and drivers that ping every few seconds: R-trees, geohash, H3 and S2 cells, Redis GEO and OpenSearch. One-hour boards for junior, senior and staff, with the theory.
Buy the cheapest offer under a maximum price from 1,000 sellers: cached offers, coalesced quotes, a hold-order-capture saga, open requests.
Rank 200 million players in real time with sharded Redis sorted sets, count every game exactly once, and close a season fairly.
Exact, semantic and prefix caching in front of LLMs: scoped keys, distances with an error budget, tenant isolation, invalidation and measured savings.
The URL shortener with a payload: the same id generation and cache-first read path, but the value is kilobytes of text, so it moves out of the database and into object storage.