16. Common System Design Problem Patterns
URL shortener
- Key concerns: unique ID generation, redirect latency, cache hit ratio, abuse prevention, analytics, and link expiration.
- Typical approach: stateless API services, durable mapping store, cache, and asynchronous analytics.
Chat application
- Key concerns: online presence, message ordering, delivery acknowledgements, reconnects, unread counts, and media.
- Typical approach: persistent message store, WebSocket or other real-time transport, durable messaging pipeline, and object storage for media.
News feed
- Key concerns: fan-out, ranking, freshness, celebrity accounts, and pagination.
- Typical approach: hybrid fan-out strategy, precomputed feed entries for selected workloads, caching, and cursor pagination.
Rate limiter
- Key concerns: key scope, distributed counters, burst behavior, fairness, and fail-open versus fail-closed policy.
- Typical approach: token bucket or leaky bucket, atomic shared state when distributed enforcement is required, and local protection for resilience.
File storage and sharing
- Key concerns: large uploads, resumability, access control, metadata, versioning, and lifecycle.
- Typical approach: object storage for bytes, database for metadata and permissions, signed upload/download URLs, and asynchronous processing.
Notification system
- Key concerns: fan-out, provider quotas, retries, user preferences, deduplication, and delivery tracking.
- Typical approach: durable queue, worker pools, provider-specific adapters, retry scheduling, and dead-letter handling.
Ride matching or delivery dispatch
- Key concerns: geospatial lookup, real-time location, assignment races, fairness, and timeouts.
- Typical approach: geospatial index, short-lived location state, atomic assignment transitions, and event-driven updates.
Video streaming
- Key concerns: large bandwidth, adaptive bitrate, global delivery, transcoding, and storage cost.
- Typical approach: object storage, asynchronous transcoding pipeline, CDN, and playback manifests.
Search and autocomplete
- Key concerns: indexing delay, relevance, prefix queries, freshness, and typo tolerance.
- Typical approach: dedicated search index, asynchronous index updates, caching for popular queries, and authoritative storage elsewhere.
For each problem, explain requirements first, estimate scale, model data, draw the request path, and then deep dive into the highest-risk bottleneck.
Key Takeaways
- Recognize recurring architecture patterns across interview prompts.
- Focus on each problem's distinctive bottleneck and correctness constraints.
- Explain how data is written, read, updated, and recovered.
- Treat example architectures as starting points, not universal solutions.