Knowledge / Computer Science and Engineering / System design case studies

System design case studies

Computer Science and Engineering (B.E./B.Tech) · Web, cloud and design · free study notes for exams, placements and interviews

In short

A system design case study asks you to take one real product - a URL shortener, a social feed, a chat app, a video stream, a payments switch - and turn it into a concrete architecture: requirements, traffic and storage estimates, APIs, data model, components, and the trade-offs you chose. The skill examined is not memorising a diagram but defending numbers and failure behaviour. It is the main round for SDE-2 and above, and now appears for freshers at Flipkart, Swiggy, Zomato, Razorpay, PhonePe, Zerodha, Atlassian, Amazon, Google India, Walmart Global Tech, Uber and Ola; universities examine it in software architecture / distributed systems papers and in final-year project vivas. GATE CS does not ask open design, but its DBMS, OS and CN theory supplies every building block used here.

Explained

How to attack a case study in 35-45 minutes

  1. Clarify and scope (5 min). Ask for functional requirements (what the user does), non-functional ones (latency, availability, consistency, durability), and scale (DAU, read:write ratio, retention). Then say out loud what you are *not* building - interviewers reward scoping, not bravado.
  2. Estimate (5 min). Convert DAU into QPS, storage per day and per year, bandwidth, and number of machines. Use round numbers: 1 lakh = 10⁵, 1 crore = 10⁷, a day = 86,400 s ≈ 10⁵ s.
  3. Define the API (3 min). 3-6 endpoints with request/response fields. This fixes the contract before you draw boxes.
  4. Data model (5 min). Tables/collections, primary key, the access patterns each index serves, and the shard key. Choosing the shard key *is* the design decision.
  5. High-level design (8 min). Client → DNS/CDN → load balancer → API/application tier (stateless) → cache → database, with queues for anything asynchronous and object storage for blobs.
  6. Deep dive where the interviewer points (10 min). One or two of: hot keys, fan-out, ID generation, exactly-once semantics, geo-replication, back-pressure.
  7. Failures and trade-offs (5 min). What happens if a shard, a region or the cache dies; what you sacrifice (usually strong consistency or cost) and why that is acceptable for *this* product.
  8. Numbers to carry in your head: memory read ~100 ns, SSD read ~100 µs, same-datacentre round trip ~0.5 ms, Mumbai→Singapore ~60-70 ms, Mumbai→US-East ~220 ms; one commodity node handles roughly 1,000-5,000 simple API requests/s, a single Redis instance 50,000-100,000 ops/s, one relational primary a few thousand writes/s.

Case 1 - URL shortener and rate limiter (read-heavy, write-light)

Case 2 - Social feed and notifications (Twitter/X, Instagram, Koo-style)

Case 3 - Chat and presence (WhatsApp)

Case 4 - Video streaming at IPL scale (JioHotstar / Netflix / SonyLIV)

Case 5 - Money and scarce inventory (UPI, IRCTC Tatkal, flash sales)

Case 6 - Location and matching (Ola, Uber, Rapido, Swiggy, Zomato, Dunzo)

Key points

Formulas and examples

QPS_avg = DAU × actions per user per day ÷ 86,400 s; QPS_peak ≈ QPS_avg × peak factor (3-5 for consumer apps; 20-100 for event spikes)
Storage per day = writes/day × bytes per record × replication factor (usually 3)
Bandwidth (bps) = concurrent users × bitrate per user (bps)
Key space with N characters of base-62 = 62N distinct codes
Snowflake 64-bit ID = 1 unused + 41 bits ms timestamp + 10 bits machine + 12 bits sequence → 4,096 IDs per ms per machine, 2⁴¹ ms ≈ 69.7 years of range
Little's law: L = λ × W (L = requests in flight, λ = arrival rate per s, W = average latency in s)
Nodes = ceil(peak load ÷ per-node capacity) + spares (N+2 for maintenance plus one failure)
Availability in series = A₁ × A₂ × …; with k independent redundant copies = 1 − (1 − A)k
Annual downtime (minutes) = (1 − A) × 525,600
Effective read latency = h × T_cache + (1 − h) × (T_cache + T_db), h = cache hit ratio

Example 1 - URL shortener sizing. 10 crore (10⁸) new URLs/day, read:write 100:1, record 500 bytes, replication 3, retention 5 years.

Example 2 - Feed fan-out, push vs pull. 20 crore DAU, 5 crore posts/day, average 200 followers, each user opens the timeline 10 times/day.

Example 3 - Live cricket bandwidth and cost. 2.5 crore (25 million) concurrent viewers, average delivered bitrate 3 Mbps, 4-hour match, CDN offload 96%.

Example 4 - Payments capacity and availability. 600 crore (6 × 10⁹) transactions/month, peak factor 4, node capacity 2,000 TPS, per-transaction latency 40 ms.

Example 5 - Cache hit ratio. Cache read 1 ms, database read 50 ms.

Case studyDominant loadStore of choiceConsistencyKey risk
URL shortenerRead-heavy 100:1KV store + cacheEventualHot code, key collisions
Social feedWrite amplificationWide-column + Redis listsEventualCelebrity fan-out
ChatPersistent connectionsWide-column, per-user queuesPer-conversation orderGateway capacity, offline backlog
Live videoEgress bandwidthObject storage + CDNN/A (immutable segments)Peak concurrency, CDN failure
PaymentsCorrectnessRelational, append-only ledgerStrong (CP)Duplicates, partial failure
Ride-hailingLocation writesIn-memory geo index + RDBMSMixedHot city shard, stale locations
Fan-out strategyWrite costRead costBest for
Push (on write)HighVery lowMost users, few followers
Pull (on read)Very lowHighCelebrities, inactive users
HybridMediumLowProduction social feeds

Where it is used

Interview questions

Common mistakes

Related topics

System design basics for freshers · Caching, queues and CDNs · REST APIs · Containers: Docker and Kubernetes · AWS core services · Cloud computing basics

Open in the Knowledge reader →Find jobs →