hardCase StudyDesign
Video streaming startup time is won before playback: transcode into an adaptive ladder, cut aligned segments, package a manifest, and cache the first low-bitrate segment near the viewer. At play time the system can only afford manifest fetch, licence check, first segment and decoder start. It also connects adaptive bitrate to the point an interviewer is testing.
hardDesignCase Study
Size it first: 200M daily actives opening the feed six times a day is 42k reads/s at peak, while 100M posts fanned out to 200 followers each is 231k feed writes/s, so writes dominate. Push to ordinary accounts, pull for high-follower ones, and store ids so deletes and blocks filter on read.
hardDesignCase Study
Clarify scale first, then size it: 100M new links a day at a 100:1 read ratio gives roughly 1.2k writes/s and 116k redirects/s, needing 7-character base62 keys. Generate keys from leased counter blocks scrambled by a bijection, serve reads from cache and CDN, and redirect with 302 rather than 301.
hardCase StudyDesign
Ride matching system design should rank drivers by estimated pickup time and market impact, not straight-line distance. Offer the ride under a short soft lock, use a small batching window when it improves assignment quality, and keep the rider wait within a few seconds. Use this dispatch answer to show the decision, trade-off, and evidence rather than a memorised definition.
hardScenarioDesign
An authoritative breakdown of horizontal matchmaking services, constraint relaxation algorithms, and distributed locking for ticket-based lobbies. Use this matchmaking answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects SBMM to the point an interviewer is testing.
hardCase StudyDesign
CDN caching for global reads works when cacheable bytes are separated from personalised fragments. Use content-addressed assets, tag-based purges for pages that must change, and plan for purge storms because invalidation sends cold traffic back to the one origin region. It also connects http caching to the point an interviewer is testing.
hardCase StudyDesign
Paid video streaming DRM raises the cost of copying rather than making copying impossible. Start with signed short-lived URLs, add encrypted segments, and use DRM when keys must stay outside application code, while budgeting for licence latency and unsupported devices.
hardCase StudyDesign
Real-time pricing system design should publish numbered price versions instead of calculating a different answer per request. Compute prices by region and time window, serve the current version consistently, and freeze quotes briefly so users are not surprised during checkout.
hardCase StudyDesign
Selling a specific seat is a uniqueness problem, not a throughput one, so the seat row is the serialisation point and the design lives or dies on the reservation hold: a short expiring claim written atomically, plus a queue in front so the contention never reaches the database at full force.
hardCase StudyDesignScenario
Preventing double booking seats means claiming the seat before payment, not racing two payments and reconciling later. A short atomic hold serialises buyers, payment only starts for the winner, and uncertain payment outcomes are settled by reconciliation rather than silent expiry.