Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

Roadmaps › CS Fundamentals

System Design Roadmap

Scalability, databases, caching, queues and real case studies — prepare for system design and low-level design interviews.

Level: Intermediate → Advanced · Duration: 2–3 months

Step 1: Foundations

The vocabulary of every system design interview.

System design interviews test how you build software for millions of users. Start with the vocabulary and the habit of estimating numbers.

  • Scaling up vs scaling out
  • Latency, throughput and availability
  • How clients talk to servers
  • How users reach your servers (DNS, CDN)

Resources: Notes: System Design Basics: Scalability · Interview questions: System Design · ▶ System Design Playlist

Scalability

Vertical vs horizontal scaling.

Scalability is handling more load by adding resources. Stateless servers make horizontal scaling easy.

  • Vertical vs horizontal scaling
  • Stateless application servers
  • Bottlenecks and single points of failure

Latency, throughput & availability

Nines, SLAs, back-of-envelope maths.

Numbers drive designs: requests per second, storage per year, acceptable downtime.

  • Latency numbers every engineer should know
  • Availability "nines" (99.9% ≈ 8.8 hours/year down)
  • Back-of-envelope estimation (QPS, storage, bandwidth)
  • SLA, SLO, SLI

Client–server & HTTP

APIs, REST, status codes.

Most systems are clients calling APIs over HTTP.

  • Request/response, statelessness
  • REST resource design
  • Status codes and idempotency

Resources: Notes: HTTP and HTTPS

DNS & CDNs

How users reach your servers.

DNS directs users to the right servers; CDNs serve static content from nearby locations.

  • DNS resolution and TTLs
  • GeoDNS and anycast
  • Push vs pull CDNs

Resources: Notes: DNS

Step 2: Load balancing & proxies

Spread traffic and remove single points of failure.

Load balancers spread traffic across servers and remove failed ones; proxies add security and caching.

  • Load balancer types and algorithms
  • Reverse proxies and gateways
  • Consistent hashing

Resources: Notes: Load Balancing

L4 vs L7 load balancers

Algorithms and health checks.

Layer 4 balances TCP connections; layer 7 understands HTTP and can route by path.

  • Round robin, least connections, IP hash
  • Health checks
  • Avoiding the LB as a single point of failure

Reverse proxies & API gateways

Nginx, rate limiting.

A single entry point handles TLS, auth, rate limits and routing.

  • Nginx / Envoy
  • API gateway responsibilities
  • Rate limiting at the edge

Consistent hashing

Distribute keys with minimal movement.

Adding or removing a node should move only a small fraction of keys — essential for caches and shards.

  • The hash ring
  • Virtual nodes
  • Where it is used (DynamoDB, Cassandra, CDNs)

Step 3: Databases

Choosing and scaling storage.

Choosing and scaling the database is the core of most designs.

  • Picking SQL or NoSQL
  • Indexes
  • Replication and sharding
  • Consistency trade-offs

Resources: Notes: Indexing and SQL vs NoSQL

SQL vs NoSQL

Relational, document, key-value, wide-column, graph.

Choose by data shape, query patterns and consistency needs, not by hype.

  • Relational (MySQL, PostgreSQL)
  • Document (MongoDB), key-value (Redis, DynamoDB)
  • Wide-column (Cassandra), graph (Neo4j)
  • When joins and transactions matter

Indexing

B+ trees, composite indexes.

Indexes make reads fast at the cost of slower writes and more storage.

  • B+ tree indexes
  • Composite indexes and column order
  • Covering indexes

Replication & sharding

Leaders, followers, shard keys.

Replicate for reads and availability; shard for writes and size.

  • Leader–follower replication and lag
  • Sharding strategies and shard keys
  • Hot spots and resharding

Resources: Notes: Database Sharding and Replication

CAP & consistency

Trade-offs in distributed data.

In a partition you must choose consistency or availability.

  • CAP and PACELC
  • Strong vs eventual consistency
  • Quorums (W + R > N)

Resources: Notes: CAP Theorem and Consistency

Step 4: Caching

The fastest request is the one you don't make.

Caches cut latency and database load dramatically — but bring staleness and invalidation problems.

  • Where to cache
  • Cache patterns
  • Eviction and invalidation
  • CDN caching

Resources: Notes: Caching, CDN and Databases at Scale · Redis documentation

Cache strategies

Cache-aside, write-through, write-back.

How reads and writes interact with the cache.

  • Cache-aside (lazy loading)
  • Write-through and write-back
  • Read-through

Eviction & invalidation

LRU, TTLs, stampedes.

"There are only two hard things in computer science: cache invalidation and naming things."

  • LRU, LFU, TTL
  • Invalidating on writes
  • Thundering herd / cache stampede protection

CDN caching

Static and edge caching.

Serve static and even dynamic content from the edge.

  • Cache-Control headers
  • Cache keys and purging
  • Edge functions

Step 5: Asynchronous processing

Decouple services with queues and events.

Queues let slow work happen in the background and smooth traffic spikes.

  • Message queues and brokers
  • Delivery guarantees
  • Event-driven patterns

Resources: Notes: Message Queues and Event-Driven Systems

Message queues

Kafka, RabbitMQ, SQS.

Producers publish, consumers process at their own pace.

  • Point-to-point vs pub/sub
  • Kafka vs RabbitMQ vs SQS
  • Partitions and consumer groups

Delivery guarantees

At-least-once, idempotency, DLQs.

Messages can be lost or duplicated; design for it.

  • At-most-once, at-least-once, exactly-once
  • Idempotent consumers
  • Retries with backoff and dead-letter queues

Event-driven patterns

Pub/sub, sagas, outbox.

Patterns for coordinating services through events.

  • Pub/sub and fan-out
  • Saga pattern for distributed transactions
  • Transactional outbox
  • CQRS and event sourcing

Step 6: APIs & communication

How services talk to each other.

Pick the right protocol for each interaction between clients and services.

  • API styles
  • Real-time communication
  • Rate limiting
  • Service boundaries

Resources: GraphQL documentation

REST, GraphQL & gRPC

Trade-offs of each.

Each style fits different needs.

  • REST for public APIs
  • GraphQL for flexible client queries
  • gRPC for fast service-to-service calls
  • Pagination (offset vs cursor)

Real-time

WebSockets, SSE, long polling.

Chats, live scores and notifications need server-pushed updates.

  • WebSockets
  • Server-Sent Events
  • Long polling

Rate limiting

Token bucket, sliding window.

Protect services from abuse and overload.

  • Token bucket and leaky bucket
  • Fixed vs sliding window
  • Distributed rate limiting with Redis

Microservices vs monolith

When to split.

Microservices give independent scaling and deploys, but add network and operational complexity.

  • When a monolith is better
  • Service boundaries by domain
  • Service discovery

Step 7: Reliability & observability

Design for failure.

Everything fails eventually. Good designs expect failure and make it visible.

  • Redundancy
  • Resilience patterns
  • Monitoring and alerting

Redundancy & failover

Multi-AZ, health checks.

No single machine, zone or region should take the system down.

  • Active–passive vs active–active
  • Multi-AZ and multi-region
  • Backups and disaster recovery

Retries, timeouts & circuit breakers

Stop cascading failures.

Stop one slow dependency from taking everything down.

  • Timeouts on every network call
  • Retries with exponential backoff and jitter
  • Circuit breakers and bulkheads

Monitoring

Metrics, logs, traces, alerts.

Know about problems before users do.

  • Metrics, logs and traces
  • Golden signals
  • Alerting on SLOs

Step 8: Low-level design

Class design and patterns for LLD rounds.

LLD rounds ask you to design classes for a small system and write clean, extensible code.

  • OOP and SOLID
  • Common design patterns
  • Practice problems

Resources: Notes: SOLID Principles · Notes: Low-Level Design: Parking Lot · ▶ Low Level Design

OOP & SOLID

Clean, extensible classes.

Clean class design is the foundation of LLD.

  • Encapsulation, inheritance, polymorphism, abstraction
  • Single responsibility and open/closed
  • Composition over inheritance

Resources: Notes: Four Pillars of OOP

Design patterns

Singleton, factory, strategy, observer.

Patterns are named solutions to recurring design problems.

  • Creational: singleton, factory, builder
  • Structural: adapter, decorator
  • Behavioural: strategy, observer, state

LLD practice

Parking lot, elevator, BookMyShow, Splitwise.

Practise by modelling real systems with classes, relationships and key methods.

  • Parking lot
  • Elevator system
  • Movie ticket booking
  • Splitwise / expense sharing

Step 9: Case studies

Practise full designs out loud.

Interviews follow a structure: requirements → estimates → API → high-level design → deep dives → trade-offs. Practise out loud.

  • The interview framework
  • Classic designs
  • Discussing trade-offs

Resources: Mock interview · ▶ System Design Playlist

URL shortener

Hashing, key generation, redirects.

A great first case study covering IDs, databases and caching.

  • Short code generation (base62, counters)
  • Read-heavy caching
  • Analytics and expiry

Resources: Notes: Design a URL Shortener

Chat application

WebSockets, delivery, presence.

Real-time messaging with delivery guarantees.

  • WebSocket servers and session store
  • Message storage by conversation
  • Receipts, presence and groups

Resources: Notes: Design a Chat Application

News feed

Fan-out on write vs read.

Generating a personalised feed for millions of users.

  • Fan-out on write vs on read
  • Celebrity problem
  • Ranking and caching feeds

Rate limiter, notification system, file storage

More classic questions.

More common questions to practise.

  • Distributed rate limiter
  • Notification service with queues and retries
  • File storage like Google Drive (chunks, sync, dedupe)