High-Level Design cheat sheet
- The HLD Interview Framework: A step-by-step method for running a design interview, from requirements to deep dives.
- Back-of-the-Envelope Estimation: Numbers every engineer should know and how to turn them into QPS, storage and bandwidth.
- Networking Essentials: DNS, TCP vs UDP, HTTP versions and TLS — what actually happens between client and server.
- Scalability: Vertical vs Horizontal: Scaling up vs out, stateless services, and where state should live.
- Load Balancing: L4 vs L7, balancing algorithms, health checks, and avoiding a single point of failure.
- Choosing a Database: SQL vs NoSQL: Relational, key-value, document, wide-column and graph stores — and how to choose.
- Indexing & Storage Engines: B-Trees vs LSM-Trees, secondary indexes, and why writes and reads pull in opposite directions.
- Transactions, Isolation & MVCC: ACID in practice, isolation anomalies, MVCC, locking and optimistic concurrency.
- Replication: Leader-follower, multi-leader and leaderless replication, replication lag and failover.
- Partitioning & Sharding: Splitting data across machines: range vs hash partitioning, hot spots and rebalancing.
- Consistent Hashing: The hash ring, virtual nodes, and why adding a server should not reshuffle everything.
- Object Storage & File Uploads: How S3-style storage works, presigned URLs, multipart and resumable uploads.
- CAP Theorem & PACELC: What CAP really says, what it does not, and the latency trade-off PACELC adds.
- Consistency Models: Linearizability, sequential, causal, read-your-writes and eventual consistency — and quorums.
- Time, Clocks & Ordering: Clock skew, Lamport clocks, vector clocks and hybrid logical clocks.
- Consensus, Leader Election & Locks: Raft, ZooKeeper/etcd, leases, fencing tokens, gossip and failure detection.
- Distributed Transactions: Two-phase commit, Sagas, the outbox pattern and idempotent workflows.
- Unique ID Generation: UUIDs, ticket servers, Snowflake IDs and ULID/UUIDv7.
- Caching: Cache layers, read/write strategies, eviction, invalidation, and stampedes.
- Content Delivery Networks: Edge caching, push vs pull CDNs, cache keys and invalidation for static and dynamic content.
- API Design: REST, gRPC, GraphQL: Resource modelling, pagination, versioning, idempotency and choosing a protocol.
- Real-Time Communication: Short polling, long polling, Server-Sent Events and WebSockets — and scaling persistent connections.
- Message Queues & Event Streaming: Queues vs logs, delivery guarantees, ordering, consumer groups and back-pressure.
- Monoliths, Microservices & Service Discovery: When to split, service boundaries, discovery, API gateways and service meshes.
- Event-Driven Architecture, CQRS & Event Sourcing: Events vs commands, choreography vs orchestration, CQRS and event sourcing.
- Batch & Stream Processing: OLTP vs OLAP, MapReduce/Spark, Flink, windows, watermarks, Lambda and Kappa.
- Search & Inverted Indexes: Tokenisation, inverted indexes, relevance ranking, and running Elasticsearch at scale.
- Geospatial Indexing: Geohashes, quadtrees, S2 and H3 — finding what is nearby, fast.
- Probabilistic Data Structures: Bloom filters, HyperLogLog, Count-Min Sketch and top-K heavy hitters.
- Rate Limiting: Token bucket, leaky bucket, fixed and sliding windows, and distributed rate limiting.
- Availability & Fault Tolerance: SLAs and nines, redundancy, timeouts, retries with backoff, circuit breakers and idempotency.
- Observability: Metrics, logs, traces, SLO-based alerting and debugging distributed systems.
- Multi-Region Architecture: Active-passive vs active-active, data placement, global routing and disaster recovery.
- Security Fundamentals: Authentication, authorization, OAuth 2.0/OIDC, JWTs, encryption and secrets.
- Design a URL Shortener: Key generation, redirects at scale, caching and analytics.
- Design a Distributed Rate Limiter: A rate-limiting service shared by many API servers.
- Design a Notification System: Multi-channel delivery, preferences, retries and deduplication.
- Design Search Autocomplete: Tries, top-k precomputation, freshness and personalisation.
- Design a Web Crawler: URL frontier, politeness, deduplication and recrawl scheduling.
- Design a News Feed: Fan-out on write vs read, ranking and celebrity users.
- Design a Chat System: WebSockets, message ordering, presence, groups and offline delivery.
- Design Cloud File Storage (Dropbox): Chunking, deduplication, sync, conflicts and metadata.
- Design a Real-Time Leaderboard: Sorted sets, O(log n) ranks, ties, monthly boards and sharding by score.
- Design a Ride-Hailing Service: Location updates, geo-indexing, matching and trip state.
- Design a Video Streaming Platform: Upload pipeline, transcoding, adaptive bitrate and CDN delivery.
- Design a Ticket Booking System: Seat holds, contention, virtual waiting rooms and payments.
- Design a Payment System: Ledgers, idempotency, PSP integration and reconciliation.
- Design an Ad Click Aggregator: Stream aggregation, exactly-once counting and reconciliation.
- Design a Distributed Job Scheduler: Scheduling at scale, leases, retries and exactly-once execution.
- Design a Collaborative Editor (Google Docs): OT vs CRDTs, sessions, presence and persistence.
- Design a Distributed Key-Value Store: Partitioning, replication, quorums, repair and storage engine.
- Design a Distributed Message Queue (Kafka): Partitioned logs, replication and ISR, consumer groups and delivery semantics.
- Design Metrics Monitoring & Alerting: Time-series storage and compression, cardinality, rollups and reliable alerting.
- Design a Stock Exchange: Order books, price-time matching, sequencing, determinism and low latency.
- Recurring Design Patterns: The ten problem shapes behind almost every design question, and the standard answers.
- HLD Cheat Sheet: Numbers, trade-offs and decision tables on one page for last-minute revision.