Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
System Design
The classics — a URL shortener, a rate limiter, a news feed — built from generic components rather than one cloud’s services. Read the scenario, build the design, submit. You get a percentage against what the brief requires, and a written review of what you built and why.
A team is building a link shortener. A user pastes a long URL and gets back a short link; anyone who opens the short link is redirected to the original address. Every short link must carry a code that is unique across the whole system, and the service will hand out billions of them over time. The mappings from code to URL are tiny, never change once written, and are looked up far more often than they are created — a popular link can be opened thousands of times a second. Redirects have to feel instant even under that read load, while creating a link can be a little slower.
A public API is being abused: a few clients fire thousands of requests a second and starve everyone else. The team wants to cap each client to a fixed number of requests per time window and reject the rest immediately, before any real work is done. The check has to be cheap, because it runs on every single request, and it has to be consistent across a fleet of identical API servers behind a load balancer, so a client cannot slip past simply by being routed to a different server each time. The limits themselves change rarely.
As a user types into a search box, the product shows the most likely completions after each keystroke — and it has to come back within a few milliseconds, or the suggestions feel laggy and get ignored. Completions are ranked by how often each phrase has been searched before, and the catalogue of phrases is large. The read volume is enormous: every keystroke from every user is a lookup, and most of those lookups are for the same short, popular prefixes. Building and ranking the list of completions is done in the background, not on the typing path.
A team is building a paste-sharing tool. A user submits a block of text — anything from a few lines to a large log file of several megabytes — and gets back a link that others can open to read it, unchanged. Each paste needs its own identifier that cannot be guessed or stepped through in sequence, so one paste's link never reveals another's. Pastes are written once and never edited, are read far more often than they are written, and most traffic lands on a small number of popular pastes. Storing many large text blobs cheaply matters, and the tool should stay fast when a paste goes viral.
© 2026 PlayCloudLabs. All rights reserved. Not affiliated with Amazon Web Services.