Skip to main contentOpteroAIBeta

System Design interview questions

System design interview questions testing your ability to architect scalable, reliable systems. These are common in senior and staff-level interviews.

12 questions
1 easy4 medium7 hard

1.Design a chat application like Slack or WhatsApp.

hard
How to approach thisCover: real-time messaging (WebSockets or long polling), message storage (time-series partitioning), presence indicators, read receipts, group chats, media handling (S3 + CDN), push notifications, and end-to-end encryption. Start with the core flow (send message, receive message) and expand.

2.How would you design a news feed system like Twitter's home timeline?

hard
How to approach thisTwo approaches: fan-out on write (push new tweets to all followers' timelines at write time) or fan-out on read (aggregate at read time). Push is faster to read but expensive for users with millions of followers. Most systems use a hybrid: push for normal users, pull for celebrities. Discuss caching, ranking, and pagination.

3.Design a distributed cache like Redis.

hard
How to approach thisCover: data structures (strings, hashes, sorted sets), consistent hashing for key distribution across nodes, replication for high availability, eviction policies (LRU, LFU, TTL), persistence options (RDB snapshots vs. AOF), and the trade-off between consistency and performance. Discuss how clients discover which node holds their key.

4.How would you design a file storage service like Dropbox?

hard
How to approach thisBreak the file into chunks (4-8MB), deduplicate by content hash, store chunks in blob storage (S3). Use a metadata service to track file structure, permissions, and version history. Sync client detects local changes, uploads deltas, and resolves conflicts. Discuss how you handle concurrent edits to the same file.

5.Design a notification system that supports email, push, SMS, and in-app notifications.

medium
How to approach thisUse a priority queue with separate workers per channel. Each notification event specifies the template, recipient, and channels. Handle user preferences (opt-outs, quiet hours), deduplication (do not send the same notification twice), rate limiting (no notification storms), and delivery tracking. Store templates separately from delivery logic.

6.How would you design a rate limiter for a distributed system?

medium
How to approach thisDiscuss algorithms: token bucket (flexible burst), sliding window counter (accurate), fixed window (simple but bursty). For distribution, use a centralized store (Redis) with atomic operations (INCR + EXPIRE or Lua scripts). Cover per-user vs. per-IP vs. per-endpoint limits, 429 responses with Retry-After headers, and graceful degradation.

7.Design a search autocomplete system.

medium
How to approach thisUse a trie (prefix tree) for fast prefix lookups, stored in memory for speed. Rank suggestions by popularity (precomputed from query logs). For scale, shard by prefix range. Update popularity counts asynchronously via a pipeline that processes query logs. Cache the top suggestions for common prefixes at the edge.

8.How would you design a video streaming platform like YouTube?

hard
How to approach thisCover: upload pipeline (transcode to multiple resolutions/codecs using a job queue), storage (blob store + CDN), adaptive bitrate streaming (HLS/DASH), metadata service, recommendation engine, and comment/like system. Focus on the critical path: upload, transcode, and play. Discuss how CDN reduces latency for viewers worldwide.

9.Design an e-commerce inventory system that prevents overselling.

medium
How to approach thisUse pessimistic locking (SELECT FOR UPDATE) or optimistic locking (version column) on the inventory count. For high-concurrency items, use a reservation pattern: decrement inventory when added to cart (with TTL), confirm on purchase, release on timeout. Discuss distributed inventory across warehouses and eventual consistency trade-offs.

10.How would you design a web crawler that indexes billions of pages?

hard
How to approach thisComponents: URL frontier (priority queue of URLs to crawl), fetcher (HTTP client with politeness policies like robots.txt and crawl-delay), content parser (extract links and text), deduplication (content hash to avoid re-indexing duplicate pages), and storage (inverted index). Discuss BFS vs. DFS crawling strategy and politeness.

11.Design a metrics collection and monitoring system like Datadog.

hard
How to approach thisAgents on each host collect metrics and send them to an ingest layer. Use a time-series database (InfluxDB, TimescaleDB) for storage. Support pre-aggregation at ingest for high-cardinality metrics. Build a query engine for dashboards and alerting rules. Discuss retention policies, downsampling old data, and anomaly detection.

12.How would you design a URL shortener that handles 100 million URLs?

easy
How to approach thisGenerate short codes using base62 encoding of an auto-increment ID or a hash (first 7 chars of MD5). Store the mapping in a key-value store. For reads, use a cache (Redis) in front of the DB since reads far outnumber writes. Discuss custom aliases, expiration, analytics (click tracking), and 301 vs. 302 redirects.

Prepare further

More interview topics