Phase 17 Interactive Simulators(26)

Browse all 26 labs →
🔗 Base62 Key Space Lab — full guide →

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

Keys issued0~0% of space
Next counter ID1,000,000
DB reads / 1k clicks10
Avg redirect latency0.74 ms
Analytics clicks captured1000/1000
RECENT SHORT KEYS (tiny.url/…):

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.

PHASE 17 CURRICULUM

Classic Practice Problems

Progress0 of 26 (0%)

Master the iconic 26 system design interview problems:

Key Architectural Domains & Syllabus
TinyURL
Rate Limiter
Pastebin
Web Crawler
Distributed Cache
Snowflake ID Generator
WhatsApp Chat
YouTube Streaming
Uber Ride-Sharing
Ticket Booking
26 In-Depth Topics ~208 Minutes Reading Time Interactive Quizzes & Assessments

All Topics in Phase 17

0 of 26 completed

Architect a global URL shortener: Base62 encoding vs MD5 hashing, collision handling, Range-Based Counter Token Servers (ZooKeeper), and Redis caching.

9 min read•2 Quiz Questions

Protect APIs from overload: Token Bucket in Redis with Lua scripts, Sliding Window Counters, race condition handling, and Gateway edge integration.

9 min read•2 Quiz Questions

Store and share plain text snippets: Object storage (S3) for paste content, Relational/NoSQL metadata indexing, TTL auto-expiration, and custom vanity URLs.

8 min read•2 Quiz Questions

Crawl the World Wide Web: URL Frontier, Politeness policies (robots.txt, domain delay), Duplicate detection (Bloom Filters & SimHash), and distributed workers.

9 min read•2 Quiz Questions

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.

10 min read•2 Quiz Questions

Implement Amazon's Dynamo paper: Tunable Quorum consistency ($N, W, R$), Vector Clocks for conflict detection, Gossip membership, Hinted Handoff, and Merkle Trees.

10 min read•2 Quiz Questions

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.

9 min read•2 Quiz Questions

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.

9 min read•2 Quiz Questions

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.

10 min read•2 Quiz Questions

Architect real-time chat: Persistent WebSockets, Gateway connection manager, Erlang/Go actor model, message delivery status (sent, delivered, read), and group chat fan-out.

10 min read•2 Quiz Questions

Stream video at scale: Adaptive Bitrate Streaming (HLS / DASH), Video chunking, Asynchronous DAG transcoding pipelines, and CDN edge video caching.

10 min read•2 Quiz Questions

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.

10 min read•2 Quiz Questions

Prevent seat overbooking: Temporary reservation locks (10-minute hold), Distributed Redis locks with TTL, ACID seat inventory transactions, and Virtual Waiting Rooms.

10 min read•2 Quiz Questions

Process high-scale e-commerce orders: Distributed cart management, atomic inventory decrementing, idempotent payment settlement, and Saga order fulfillment.

10 min read•2 Quiz Questions

Deliver instant search suggestions: Trie (Prefix Tree) data structure, Trie node caching (Top 10 suggestions per node), MapReduce prefix aggregation, and browser debouncing.

10 min read•2 Quiz Questions

Sync files across devices: Chunking (4MB blocks), Content-addressed storage (SHA-256 hash), Delta sync (rsync algorithm), metadata synchronization, and conflict resolution.

10 min read•2 Quiz Questions

Unify social media primitives: User follow graph (Graph DB / B-Tree), photo upload presigned pipeline, Redis home timeline feed, and follower counters.

10 min read•2 Quiz Questions

Guarantee zero money loss: Idempotency keys, Double-entry bookkeeping ledger (immutability), Reconciliation pipelines, and PCI-DSS vault tokenization.

10 min read•2 Quiz Questions

Execute millions of timed jobs: Time-bucket database partitioning, Leader-elected dispatcher, Priority task queues, and durable execution state machines.

10 min read•2 Quiz Questions

Architect edge perimeter infrastructure: Dynamic path-based routing, JWT token validation, distributed token bucket rate limiting, and circuit breaking.

10 min read•2 Quiz Questions

Rank millions of players: Redis Sorted Sets (`ZADD`, `ZREVRANGE`), Skip List internals, handling millions of score updates, and monthly archival partitioning.

9 min read•2 Quiz Questions

Find nearby places: QuadTrees in memory, Geohashes in Redis, Google S2 geometry, spatial sharding, and business review caching.

10 min read•2 Quiz Questions

Real-time multi-party video: WebRTC peer-to-peer limits, Selective Forwarding Units (SFU) vs MCU, UDP media transport, and audio mixing.

10 min read•2 Quiz Questions

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.

10 min read•2 Quiz Questions

Ingest and query trillions of metrics/logs: Agent collector (Vector/FluentBit), Kafka ingestion buffer, Time-Series DB (M3DB/Prometheus), and inverted index log storage.

10 min read•2 Quiz Questions

Count billions of ad events with zero fraud loss: Real-time stream aggregation (Apache Flink tumbling windows), exactly-once processing, and ClickHouse OLAP storage.

10 min read•2 Quiz Questions