Phase 17 Interactive Simulators(26)
Browse all 26 labs →TinyURL / Bitly: Base62 Keys, Ranges & Redirect Economics
Issue short keys from a range-based counter or truncated hash, then replay 1,000 clicks through a Redis cache tier.
Capacity 62^7 = 3,521,614,606,208 keys
Hot 20% of URLs serve 80% of the ~4,000 reads/sec traffic
Click "Shorten URL" — counters embed ID #1,000,001 as Base62; MD5 buckets may repeat keys with an -r retry suffix (DB roundtrip).
HTTP 301 lets browsers cache the redirect forever (server load collapses, click analytics die); HTTP 302 makes every click hit the Redirect Service so the Kafka analytics topic records geolocation and referrer. Sequential counters are guessable — production systems shuffle the Base62 alphabet or run the ID through a Feistel permutation before encoding.
- Base62 Key Space LabFREE
- Atomic Rate LimiterFREE
- Paste Storage SizingFREE
- Crawler Dedup FrontierFREE
- Consistent Hash Cache RingFREE
- Quorum R/W TuningFREE
- Snowflake ID Bit LayoutFREE
- Notification Channel Fan-outFREE
- Feed Fan-out Strategy
- Chat Gateway Sharding
- Transcoding Farm Throughput
- Ride Dispatch Geo Rings
- Seat Hold Reservation
- Inventory Oversell Race
- Trie Autocomplete Engine
- Chunked Dedup Sync
- Viral Counter Buffering
- Double-Entry Ledger
- Time-Bucket Scheduler
- API Gateway Auth Pipeline
- ZSET Leaderboard Ranks
- Quadtree Radius Search
- SFU Media Topology
- Anycast CDN Edge
- Gorilla TSDB Compression
- Flink Window Aggregator
Classic Practice Problems
Master the iconic 26 system design interview problems:
All Topics in Phase 17
0 of 26 completedArchitect a global URL shortener: Base62 encoding vs MD5 hashing, collision handling, Range-Based Counter Token Servers (ZooKeeper), and Redis caching.
Protect APIs from overload: Token Bucket in Redis with Lua scripts, Sliding Window Counters, race condition handling, and Gateway edge integration.
Store and share plain text snippets: Object storage (S3) for paste content, Relational/NoSQL metadata indexing, TTL auto-expiration, and custom vanity URLs.
Crawl the World Wide Web: URL Frontier, Politeness policies (robots.txt, domain delay), Duplicate detection (Bloom Filters & SimHash), and distributed workers.
Build a distributed in-memory cache: Consistent Hashing with virtual nodes, $O(1)$ LRU eviction (HashMap + Doubly Linked List), Master-Replica replication, and gossip cluster state.
Implement Amazon's Dynamo paper: Tunable Quorum consistency ($N, W, R$), Vector Clocks for conflict detection, Gossip membership, Hinted Handoff, and Merkle Trees.
Generate 64-bit unique IDs at scale: Twitter Snowflake 64-bit binary layout (1-bit sign, 41-bit timestamp, 10-bit worker ID, 12-bit sequence), time-sortability, and clock drift handling.
Send billions of push/SMS/email alerts: Multi-channel adapters (APNs, FCM, Twilio, SendGrid), user preference matrices, rate-limiting spam filters, and SQS priority queues.
Generate personalized timelines: Fan-out on Write (Push) vs Fan-out on Read (Pull), Hybrid Fan-out for celebrity accounts, Redis timeline caching, and ranking.
Architect real-time chat: Persistent WebSockets, Gateway connection manager, Erlang/Go actor model, message delivery status (sent, delivered, read), and group chat fan-out.
Stream video at scale: Adaptive Bitrate Streaming (HLS / DASH), Video chunking, Asynchronous DAG transcoding pipelines, and CDN edge video caching.
Track drivers and dispatch rides: Geospatial indexing (Uber H3 Hexagons vs Google S2 vs Geohashes), real-time driver location updates, matching engine, and surge pricing.
Prevent seat overbooking: Temporary reservation locks (10-minute hold), Distributed Redis locks with TTL, ACID seat inventory transactions, and Virtual Waiting Rooms.
Process high-scale e-commerce orders: Distributed cart management, atomic inventory decrementing, idempotent payment settlement, and Saga order fulfillment.
Deliver instant search suggestions: Trie (Prefix Tree) data structure, Trie node caching (Top 10 suggestions per node), MapReduce prefix aggregation, and browser debouncing.
Sync files across devices: Chunking (4MB blocks), Content-addressed storage (SHA-256 hash), Delta sync (rsync algorithm), metadata synchronization, and conflict resolution.
Unify social media primitives: User follow graph (Graph DB / B-Tree), photo upload presigned pipeline, Redis home timeline feed, and follower counters.
Guarantee zero money loss: Idempotency keys, Double-entry bookkeeping ledger (immutability), Reconciliation pipelines, and PCI-DSS vault tokenization.
Execute millions of timed jobs: Time-bucket database partitioning, Leader-elected dispatcher, Priority task queues, and durable execution state machines.
Architect edge perimeter infrastructure: Dynamic path-based routing, JWT token validation, distributed token bucket rate limiting, and circuit breaking.
Rank millions of players: Redis Sorted Sets (`ZADD`, `ZREVRANGE`), Skip List internals, handling millions of score updates, and monthly archival partitioning.
Find nearby places: QuadTrees in memory, Geohashes in Redis, Google S2 geometry, spatial sharding, and business review caching.
Real-time multi-party video: WebRTC peer-to-peer limits, Selective Forwarding Units (SFU) vs MCU, UDP media transport, and audio mixing.
Build a global edge cache: BGP Anycast routing, Edge Points of Presence (PoPs), Consistent Hashing cache proxy clusters, Origin Shield tiering, and cache purge propagation.
Ingest and query trillions of metrics/logs: Agent collector (Vector/FluentBit), Kafka ingestion buffer, Time-Series DB (M3DB/Prometheus), and inverted index log storage.