<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[System Design Interview Roadmap: System Design Walkthrough]]></title><description><![CDATA[52 paid walkthroughs are named with the company that asks them.
Walkthroughs of actual questions asked at named companies (Design TikTok's For You feed at Meta, Design Uber dispatch at Uber, etc.) with the trade-off discussions interviewers probe]]></description><link>https://systemdr.systemdrd.com/s/system-design-walkthrough</link><image><url>https://substackcdn.com/image/fetch/$s_!_3Z_!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd573e1-44ca-4a06-be42-264560574975_500x500.png</url><title>System Design Interview Roadmap: System Design Walkthrough</title><link>https://systemdr.systemdrd.com/s/system-design-walkthrough</link></image><generator>Substack</generator><lastBuildDate>Sat, 11 Jul 2026 19:44:00 GMT</lastBuildDate><atom:link href="https://systemdr.systemdrd.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[SystemDR Inc]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[systemdr@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[systemdr@substack.com]]></itunes:email><itunes:name><![CDATA[System Design Roadmap]]></itunes:name></itunes:owner><itunes:author><![CDATA[System Design Roadmap]]></itunes:author><googleplay:owner><![CDATA[systemdr@substack.com]]></googleplay:owner><googleplay:email><![CDATA[systemdr@substack.com]]></googleplay:email><googleplay:author><![CDATA[System Design Roadmap]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Design Google Drive / Dropbox — The Senior+ Walkthrough]]></title><description><![CDATA[This is the question that defines the file sync and storage archetype.]]></description><link>https://systemdr.systemdrd.com/p/design-google-drive-dropbox-the-senior</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-google-drive-dropbox-the-senior</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 07 Jul 2026 01:30:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!LXhg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91f60f9d-9f97-41bc-805a-63f668f5be01_468x306.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><span>This is the question that defines the file sync and storage archetype. Eight questions in the question bank are variants &#8212; iCloud Photos, distributed file systems, cloud backup services, Git-style version control storage, CDN edge caching. They share a spine: chunked file storage, metadata management, multi-device consistency, and conflict resolution. Internalize this one and you can answer all eight.</span></p></blockquote><blockquote><p><span>The surface question sounds like object storage with a UI. The probe underneath is what separates candidates: </span><strong><span>what happens when two devices modify the same file simultaneously? </span></strong><span>That conflict resolution problem &#8212; deceptively simple on the surface, genuinely hard in distributed systems &#8212; is where every L5+ interview on this question goes.</span></p></blockquote><blockquote><p><span>For L4 / mid-level: upload/download flow and basic chunked storage. For L5 / senior: delta sync (only transfer what changed, not the whole file), deduplication, and conflict detection. For L6 / staff: vector clocks or last-writer-wins with operational transforms for true conflict resolution, the consistency model across devices, and what Dropbox actually does differently from naive S3.</span></p></blockquote><p><span>The Question</span></p><p><span>&#8220;Design Google Drive or Dropbox. Users upload files from their devices. Files are accessible from any of their devices and sync automatically when changed.&#8221;</span></p><p><span>Common variants:</span></p><p><span>- &#8220;Design iCloud Drive / Apple Files.&#8221;</span></p><p><span>- &#8220;Design a cloud backup service.&#8221;</span></p><p><span>- &#8220;Design the file sync layer for a collaborative tool.&#8221;</span></p><p><span>- &#8220;Design a distributed file system.&#8221;</span></p><h3><span>Step 1 &#8212; Clarify Before You Draw</span></h3><p><strong><span>1. Individual file storage or collaborative editing? </span></strong><span>Dropbox stores files &#8212; one writer at a time, sync on save. Google Docs is collaborative editing &#8212; multiple simultaneous writers with operational transforms. These are fundamentally different systems. Clarify and scope to Dropbox-style unless told otherwise.</span></p><p><strong><span>2. What file types and size limits? </span></strong><span>Documents, images, video &#8212; or everything? Max file size matters: Dropbox supports files up to 50 GB. A naive single-upload approach collapses above a few hundred MB.</span></p><p><strong><span>3. Multi-device sync &#8212; how many devices per user? </span></strong><span>Average user: 3&#8211;5 devices. Power user: 10+. Each device must receive all changes to synced folders. This drives the notification and sync architecture.</span></p><p><strong><span>4. Versioning and deleted file recovery? </span></strong><span>Most cloud storage products retain file versions (Dropbox keeps 30&#8211;180 days of version history). Deleted files go to trash with a retention window. State the assumptions.</span></p><p><strong><span>5. What scale? </span></strong><span>Dropbox at its peak: 700 million registered users, 500 million files uploaded per day. Working assumptions: 100M DAU, 1B files stored, average file size 1 MB.</span></p><p><strong><span>6. What&#8217;s the SLO? </span></strong><span>File upload acknowledges within 5 seconds for files under 10 MB. Sync propagates to other devices within 30 seconds of the change. These two SLOs drive the architecture.</span></p><h3><span>Step 2 &#8212; Estimate</span></h3><p><span>- 100M DAU, each uploads/modifies ~5 files/day average &#8594; 500M file operations/day &#8594; ~5,800 ops/sec</span></p><p><span>- Average file size 1 MB &#8594; 5.8 TB/day of new or modified data ingested - Total files stored: 1B files &#215; 1 MB average = 1 PB</span></p><p><span>- With deduplication (identical files stored once): real storage closer to 400&#8211;600 TB (60% dedup ratio is typical)</span></p><p><span>- Metadata per file: ~500 bytes (name, path, size, hash, version, owner, timestamps) &#8594; 500 bytes &#215; 1B files = 500 GB of metadata &#8212; fits comfortably in a sharded relational database</span></p><p><span>- Change notifications: 500M operations/day / 86,400 seconds &#215; 3 devices per user average = ~17,000 notification fanouts/sec</span></p><p><span>The deduplication estimate is the senior signal in estimation. Dropbox publicly states that deduplication dramatically reduces storage costs because many users store the same files (PDFs, installers, stock photos). Mentioning deduplication in the estimation shows you&#8217;ve thought about the system&#8217;s economics, not just its architecture.</span></p><div class="callout-block" data-callout="true"><p><strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">52 FAANG Question Vault</mark></strong> &#8212; $299 one-time (or $249 for paid subscribers)</p><p>All 52 walkthroughs + 52 drill cards + 6 framework cheatsheets + the Senior+ System Design Playbook. Everything, immediately. Lifetime access with all future updates included. &#8594; [<a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">VAULT CHECKOUT LINK</a>]</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p><div><hr></div><h3><span>Step 3 &#8212; API Design</span></h3><div class="callout-block" data-callout="true"><p><span>POST /v1/files/upload/init</span></p><p><span>Body: { file_name, file_size_bytes, content_hash_sha256, parent_folder_id } Response: {</span></p><p><span>upload_id: string,</span></p><p><span>upload_urls: [{ chunk_index, presigned_s3_url }], &#8592; chunked upload</span></p><p><span>chunk_size_bytes: 4194304 (4 MB)</span></p><p><span>}</span></p><p><span>PUT {presigned_s3_url} (direct to S3 &#8212; server not in the upload path)</span></p><p><span>Body: binary chunk data</span></p><p><span>POST /v1/files/upload/complete</span></p><p><span>Body: { upload_id, chunk_etags: [{ chunk_index, etag }] }</span></p><p><span>Response: { file_id, version_id, path, created_at }</span></p><p><span>GET /v1/files/:file_id/download</span></p><p><span>Response: { presigned_download_url, expires_at }</span></p><p><span>GET /v1/sync/changes</span></p><p><span>Query: { cursor: string, limit: int } &#8592; long-poll or SSE</span></p><p><span>Response: { changes: [...], new_cursor: string, has_more: bool }</span></p><p><span>POST /v1/files/:file_id/conflict</span></p><p><span>Body: { </span></p><p><span>local_version_id, server_version_id, resolution: &#8220;keep_local&#8221; | &#8220;keep_server&#8221; | &#8220;keep_both&#8221; </span></p><p><span>}</span></p><p><strong><span>The senior moves on this API:</span></strong></p></div><p><strong><span>Chunked upload with presigned URLs. </span></strong><span>Files go directly from the client to S3 &#8212; the API server never handles the binary data. This eliminates the API tier as a bandwidth bottleneck. The upload_id ties the chunks together; the etags from each chunk PUT allow S3 to assemble the final object via S3 multipart upload completion.</span></p><p><strong><span>The /sync/changes endpoint with cursors. </span></strong><span>This is the Dropbox API model (they call it list_folder/continue). Instead of polling &#8220;what changed since timestamp X,&#8221; the client maintains an opaque cursor that encodes its sync state. The server returns everything the client has missed since that cursor position. This handles offline sync correctly: a device that was offline for 2 weeks reconnects, passes its cursor, and gets all 2 weeks of changes in one call.</span></p><p><strong><span>The /conflict endpoint. </span></strong><span>Most candidates forget this exists. Conflict resolution is a user-facing operation &#8212; the client detects a conflict, shows the user, and the user or the system decides. Having an explicit endpoint for conflict resolution signals you&#8217;ve thought about the user-facing side of the distributed systems problem.</span></p><h3><span>Step 4 &#8212; Data Model</span></h3><p><span>files table</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OZl2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OZl2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 424w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 848w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 1272w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OZl2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png" width="932" height="386" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:386,&quot;width&quot;:932,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56076,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/203652121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OZl2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 424w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 848w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 1272w, https://substackcdn.com/image/fetch/$s_!OZl2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0540c8-d1aa-4f5e-95db-38927f815ee5_932x386.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qnXd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qnXd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 424w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 848w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 1272w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qnXd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png" width="937" height="472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/feed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:472,&quot;width&quot;:937,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96715,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/203652121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qnXd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 424w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 848w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 1272w, https://substackcdn.com/image/fetch/$s_!qnXd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeed24e7-3438-4a88-9fec-2891c3fb2b99_937x472.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong><span>The content_hash &#8594; storage_key mapping is the deduplication mechanism. </span></strong><span>Before storing a file, the server checks whether content_hash already exists in the storage index. If it does, it reuses the existing S3 object and just creates a new metadata row pointing to it. The same file can be &#8220;owned&#8221; by millions of users but stored in S3 once.</span></p><blockquote><p><span>file_versions table</span></p></blockquote><p><span>version_id, file_id (FK), version_number, content_hash, size_bytes,</span></p><p><span>storage_key, created_by_device_id, created_at, is_current</span></p><p><span>Every modification creates a new version row. The is_current flag moves to the newest version. Old versions are retained for 30 days (configurable), then the storage_key reference is eligible for deletion if no other version or file points to it.</span></p><blockquote><p><span>sync_cursors table</span></p></blockquote><p><span>cursor_id, device_id, user_id, last_processed_change_id, updated_at</span></p><p><span>Each device has a cursor. When the device calls /sync/changes, the server returns all changes after last_processed_change_id for that user, then updates the cursor. The cursor is device-specific, not user-specific &#8212; each device tracks its own sync position independently.</span></p><p><span>change_log table &#8212; the sync feed</span></p><p><span>change_id (SEQUENTIAL), user_id (INDEXED), file_id, change_type</span></p><p><span>(created/modified/deleted/moved),</span></p><p><span>version_id, changed_by_device_id, changed_at</span></p><p><span>This is the append-only event log that drives sync. Every file operation appends a row. When a device calls /sync/changes?cursor=X, the query is simply: SELECT * FROM change_log WHERE user_id=:uid AND change_id &gt; :cursor_change_id ORDER BY change_id LIMIT :limit. Fast, simple, correct.</span></p><p><span>The change_id is a sequential integer (not UUID). Sequential IDs make the range query above maximally efficient. They can be generated by Postgres sequences on a per-user basis, or by a distributed ID sequence (Snowflake-style, with the user_id encoded in the ID).</span></p>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-google-drive-dropbox-the-senior">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The 30 Days Before Your Onsite]]></title><description><![CDATA[Learn System Design with System building, Subscribe Hands On coding course - LogStream]]></description><link>https://systemdr.systemdrd.com/p/the-30-days-before-your-onsite</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-30-days-before-your-onsite</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 05 Jul 2026 03:30:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!h7V5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><p><span>Learn </span><strong><span>System Design with System building, Subscribe Hands On coding course - </span><a href="https://sdcourse.substack.com/p/start-here-how-to-use-sdcourse">LogStream</a></strong></p></div><p>Thirty days. One onsite loop. Here&#8217;s the plan I&#8217;d actually follow &#8212; not the plan that covers everything, because thirty days cannot cover everything, but the plan that prepares you for the specific interview in front of you.</p><p><strong>The principle: targeted depth beats broad coverage</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Thirty days of prep that covers six archetypes shallowly will lose to twenty days of prep that covers two archetypes deeply, plus ten days of mock interviews.</p><p>The engineers who pass consistently aren&#8217;t universally prepared. They&#8217;re specifically well-prepared for the questions they&#8217;re most likely to face. At most companies, a single loop involves one or two system design questions. If you know your target company&#8217;s interview patterns, you know which two archetypes to prioritize.</p><p>Research your target company before you start prep. Look at Glassdoor, Blind, and LinkedIn connections who&#8217;ve interviewed there recently. Identify the two most commonly asked archetypes. Those are your week 1 and week 2.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Question Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Question Walkthrough</span></a></p><p><strong>Week 1 (Days 1&#8211;7): Deep drill, archetype #1</strong></p><p>Pick the most likely archetype for your target company. Read two walkthroughs from that archetype fully. Don&#8217;t drill yet &#8212; read to understand the pattern.</p><p>Then do three timed cold drills from that archetype on days 3, 5, and 7:</p><ul><li><p>Set a 50-minute timer</p></li><li><p>Design on paper with no notes, no searching</p></li><li><p>When the timer ends, open the walkthrough and compare section by section</p></li><li><p>Write down the top 3 specific gaps between your answer and the walkthrough</p></li></ul><p>By day 7, you should produce a structurally correct answer &#8212; not perfect, but with the right components in the right places and the key failure modes named.</p><p><strong>Week 2 (Days 8&#8211;14): Deep drill, archetype #2</strong></p><p>Same structure. Different archetype &#8212; your second most likely one.</p><p>After two weeks, you have deep coverage of the two archetypes most likely to come up. That alone puts you in better position than most candidates who drilled 15 questions shallowly.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h7V5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h7V5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 424w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 848w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 1272w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h7V5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png" width="1408" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1408,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1247764,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198937553?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h7V5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 424w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 848w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 1272w, https://substackcdn.com/image/fetch/$s_!h7V5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf697884-2f15-4dec-9812-d1f3bb59bbd3_1408x768.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Week 3 (Days 15&#8211;21): Coverage and breadth</strong></p><p>Spend week 3 doing shorter 30-minute drills across 4&#8211;5 archetypes you haven&#8217;t deeply covered. The goal is exposure, not mastery. Knowing the basic shape of an answer for a question you&#8217;re 20% likely to face is much better than having no answer.</p><p>The 30-minute format requires discipline: force yourself to reach the architecture step within 15 minutes. Don&#8217;t let estimation and API design consume your entire drill &#8212; practice moving through the framework efficiently.</p><p>Also in week 3: re-read the estimation numbers cheatsheet and the trade-offs cheatsheet. These apply to every question. Refreshing them mid-prep rather than at the very end gives them time to consolidate.</p><p><strong>Week 4 (Days 22&#8211;28): Two mocks with real feedback</strong></p><p>Stop reading. Stop drilling solo. Do two mock interviews with people who will give you specific, scored feedback.</p><p>The first mock: peer at your target level. Ask them to score you on the 8 dimensions of the take-home rubric. Ask them specifically whether your scoping, communication, and failure mode coverage were strong.</p><p>The second mock: someone above your target level. Their feedback will be harder to hear and more useful. What L6 candidates do that you&#8217;re not doing yet &#8212; that&#8217;s the gap you have four days to close before the interview.</p><p>After each mock: identify the single most impactful change. Spend two days on that one thing. One change made well is more valuable than ten changes made half-heartedly.</p><p><strong>Days 29&#8211;30: Consolidation only</strong></p><p>Day 29: one short drill (30 minutes), no new material. Re-read the framework cheatsheet. That&#8217;s it.</p><p>Day 30 (the day before): re-read the drill card for the archetype most likely to come up at your target company. This takes four minutes. Then stop.</p><p>Don&#8217;t read a new walkthrough the night before. New information the night before competes with everything you&#8217;ve consolidated and doesn&#8217;t have time to integrate. Rest is a legitimate and important part of preparation. Use it.</p><p><strong>What this plan produces</strong></p><p>After thirty days:</p><ul><li><p>Two archetypes with genuine depth and pattern recognition</p></li><li><p>Coverage-level familiarity with four to five additional archetypes</p></li><li><p>Two mocks with documented gaps and one specific improvement made to each</p></li><li><p>The framework cheatsheet and estimation numbers fresh in working memory</p></li></ul><p>You&#8217;ll encounter a question you&#8217;re less prepared for. When that happens, apply the framework. The six-step framework works on questions you haven&#8217;t drilled &#8212; that&#8217;s what it&#8217;s for. The warmup from four weeks of drilling makes the framework run faster and more automatically under pressure.</p><p><strong>The thing most people get wrong</strong></p><p>The ratio of reading to drilling in most engineers&#8217; prep is about 80:20. Reading walkthroughs, reading concept explainers, reading other people&#8217;s summaries.</p><p>The ratio that produces results is closer to 40:60 &#8212; 40% reading and learning, 60% timed drills and mocks. The performance gap between knowing something and producing it under pressure in front of someone is real and only closes with practice under pressure.</p><p>If you have thirty days and you spend twenty-five of them reading, you&#8217;ve done the easy part and skipped the hard part. Do the hard part.</p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong><span>Access all 52 Questions </span><a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><div><hr></div><p><strong>CTA:</strong> </p><p>Paid subscribers get one full system design walkthrough </p><p>every Tuesday &#8212; each mapped to its archetype so you build </p><p>pattern recognition, not answer memorization. </p><p>This week: Google Drive / Dropbox.</p><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><p><strong>Want the complete learning path?</strong></p><p>Unlock advanced modules, case studies, and guided exercises.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Design Netflix Streaming — The Senior+ Walkthrough]]></title><description><![CDATA[This is the question that defines the streaming media archetype.]]></description><link>https://systemdr.systemdrd.com/p/design-netflix-streaming-the-senior</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-netflix-streaming-the-senior</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 30 Jun 2026 03:30:15 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/324af9c3-c814-47c5-aa06-d7d6afe30dae_1132x657.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><span>This is the question that defines the</span></p></blockquote><blockquote><p><span>The surface question sounds manageable. Netflix streams video to 270 million subscribers. How hard can it be to store a file and serve it? The probe underneath is what makes this question a senior filter. The interviewer is not testing whether you know what a CDN is. They are testing whether you understand why naive HTTP file serving collapses at scale, what adaptive bitrate encoding is and why it exists, how a CDN edge network makes cold-start latency irrelevant, and what happens when the most-watched show in the world premieres at 9 PM and 50 million people try to start the same episode simultaneously.</span></p></blockquote><p><span>Those four problems &#8212; not the basic architecture &#8212; are where the round is decided.</span></p><p><span>For L4 / mid-level: the content storage and delivery pipeline at a high level. For L5 / senior: adaptive bitrate encoding with multiple renditions, CDN edge caching with pre-positioning, and the cold-start problem. For L6 / staff: the encoding pipeline at scale, multi-region active-active CDN strategy, the playback session architecture, quality-of-experience monitoring, and what Netflix actually does differently from a naive CDN deployment.</span></p><p><span>The Question</span></p><blockquote><p><span>&#8220;Design Netflix. Users should be able to browse a catalog of movies and TV shows and stream them on demand with high quality and low buffering.&#8221;</span></p></blockquote><p><span>Common variants:</span></p><blockquote><p><span>- &#8220;Design YouTube&#8217;s video streaming system.&#8221;</span></p><p><span>- &#8220;Design Spotify&#8217;s audio streaming.&#8221;</span></p><p><span>- &#8220;Design Twitch&#8217;s live streaming platform.&#8221;</span></p><p><span>- &#8220;Design an adaptive bitrate streaming system.&#8221;</span></p><p><span>- &#8220;Design the video encoding pipeline for a platform like Netflix.&#8221;</span></p></blockquote><p><span>The first two are nearly identical to Netflix. Twitch adds a real-time constraint (live, not on-demand) that changes the delivery model but not the encoding fundamentals. Spotify replaces video with audio &#8212; smaller files, same adaptive delivery architecture. The encoding pipeline variant focuses specifically on Phase 2 below.</span></p><h3><span>Step 1 &#8212; Clarify Before You Draw</span></h3><p><span>Six questions. The first three are load-bearing.</span></p><p><strong><span>1. On-demand only, or also live streaming? </span></strong><span>On-demand (Netflix, Spotify) and live (Twitch, live sports) have meaningfully different architectures. On-demand content can be pre-encoded, pre-cached at CDN edges, and optimized offline. Live content has a latency requirement (viewers want near-real-time) that forces a different delivery model. Clarify and scope to on-demand unless told otherwise.</span></p><p><strong><span>2. What devices must be supported? </span></strong><span>Smart TVs, mobile (iOS/Android), web browsers, game consoles. This matters because different devices support different codecs (H.264, H.265/HEVC, AV1, VP9) and different DRM systems (Widevine, FairPlay, PlayReady). Acknowledge the codec diversity; don&#8217;t try to design the full DRM system in the interview &#8212; it&#8217;s a separate subsystem.</span></p><p><strong><span>3. What are the quality and latency SLOs? </span></strong><span>Netflix targets: playback starts within 2 seconds of pressing play. Buffering events under 0.5% of total play time. 4K HDR delivery available on supported devices. These numbers drive every architecture decision &#8212; state them explicitly before drawing anything.</span></p><p><strong><span>4. What is the catalog size? </span></strong><span>Netflix has approximately 36,000 titles globally (varies by region). Each title is stored in multiple renditions and formats. State the working assumption: 36,000 titles &#215; 20 renditions &#215; ~4 GB per rendition = ~3 PB of encoded video. This estimate calibrates the storage and CDN design.</span></p><p><strong><span>5. What scale? </span></strong><span>270 million subscribers. Peak concurrent streams: approximately 15&#8211;20% of active users simultaneously &#8212; roughly 40&#8211;50 million concurrent streams. At peak (new season premiere, weekend evening), this spikes significantly. State the peak assumption explicitly.</span></p><p><strong><span>6. Does the design include recommendations, search, and the catalog UI? </span></strong><span>These are separate systems (ML recommendation engine, search index, catalog metadata API). Acknowledge they exist; scope the interview to the streaming pipeline &#8212; content ingestion, encoding, storage, and delivery. Otherwise you&#8217;ll spend 30 minutes on recommendation and never get to the hard part.</span></p><h3><span>Step 2 &#8212; Estimate</span></h3><p><span>Working assumptions:</span></p><blockquote><p><span>- 36,000 titles &#215; 20 renditions per title = 720,000 encoded files</span></p><p><span>- Average rendition size: 4 GB (HD, 2-hour movie)</span></p><p><span>- Total encoded storage: 720,000 &#215; 4 GB &#8776; </span><strong><span>3 PB </span></strong><span>of video content</span></p><p><span>- Metadata storage (titles, posters, descriptions, subtitles): ~5 TB &#8212; trivial by comparison - Peak concurrent streams: 50 million</span></p><p><span>- Average bitrate served: 5 Mbps (mix of HD and 4K streams)</span></p><p><span>- Peak egress bandwidth: 50M streams &#215; 5 Mbps = </span><strong><span>250 Tbps</span></strong></p></blockquote><p><span>That 250 Tbps peak egress number is the most important figure in the whole estimate. Netflix is one of the largest sources of internet traffic on the planet &#8212; at peak, it accounts for roughly 15% of global downstream internet bandwidth. No single origin infrastructure serves this. CDN edge servers distributed globally are the only viable answer. State this conclusion explicitly from the estimate.</span></p><p><span>Content ingestion rate: Netflix adds roughly 500&#8211;1,000 hours of new content per month. At 20 renditions per title, that&#8217;s ~10,000&#8211;20,000 encoding jobs per month &#8212; a background batch process, not a latency-sensitive path.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p><h3><span>Step 3 &#8212; API Design</span></h3><p><span>Four APIs. The streaming API is the non-obvious one.</span></p><div class="callout-block" data-callout="true"><p><span>GET /v1/catalog</span></p><p><span>Query: page_token, limit, genre?, region</span></p><p><span>Response: { titles: [...], next_page_token }</span></p><p><span>Note: region-filtered &#8212; different catalogs per country (licensing)</span></p><p><span>GET /v1/titles/:title_id</span></p><p><span>Response: {</span></p><p><span>title_id, name, description, genres, cast,</span></p><p><span>available_resolutions: [&#8221;4K&#8221;, &#8220;1080p&#8221;, &#8220;720p&#8221;, &#8220;480p&#8221;],</span></p><p><span>subtitles: [{ language, url }],</span></p><p><span>poster_url, trailer_url</span></p><p><span>}</span></p><p><span>POST /v1/playback/start</span></p><p><span>Body: {</span></p><p><span>title_id: string,</span></p><p><span>content_id: string, (specific episode or movie version)</span></p><p><span>device_type: string,</span></p><p><span>supported_codecs: [&#8221;H264&#8221;, &#8220;H265&#8221;, &#8220;AV1&#8221;],</span></p><p><span>network_speed_mbps: float, &#8592; client measures and reports</span></p><p><span>drm_system: &#8220;widevine&#8221; | &#8220;fairplay&#8221; | &#8220;playready&#8221;,</span></p><p><span>resume_position_seconds: integer</span></p><p><span>}</span></p><p><span>Response: {</span></p><p><span>session_id: string,</span></p><p><span>manifest_url: string, &#8592; THE KEY RESPONSE FIELD</span></p><p><span>license_token: string, (for DRM decryption)</span></p><p><span>cdn_edge_url: string,</span></p><p><span>initial_quality: &#8220;1080p&#8221;,</span></p><p><span>heartbeat_interval_seconds: 30</span></p><p><span>}</span></p><p><span>POST /v1/playback/heartbeat</span></p><p><span>Body: {</span></p><p><span>session_id: string,</span></p><p><span>position_seconds: integer,</span></p><p><span>current_quality: string,</span></p><p><span>buffer_health_seconds:</span></p><p><span>float,</span></p><p><span>rebuffer_events: integer,</span></p><p><span>bandwidth_estimate_mbps: float</span></p><p><span>}</span></p><p><span>Response: { continue: true, quality_recommendation: &#8220;720p&#8221; }</span></p></div><p><strong><span>The senior move here: </span></strong><span>The </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">manifest_url </span><span>in the playback start response is the key design signal. You are not returning a video file URL &#8212; you are returning a manifest file URL. This distinction is the entire adaptive bitrate streaming architecture. Explain it before moving on.</span></p><p><strong><span>The </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">heartbeat </span><span>endpoint </span></strong><span>is the second senior signal. Netflix does not stream and forget. Every 30 seconds, the player reports back: current position, current quality, buffer health, rebuffer events, estimated bandwidth. This telemetry is the basis for quality-of-experience monitoring, A/B testing new streaming algorithms, and detecting degraded CDN nodes before users notice. Candidates who include the heartbeat signal they&#8217;ve thought about the operational layer, not just the happy path.</span></p><h3><span>Step 4 &#8212; Data Model</span></h3><p><span>Five stores. Video content itself is not in any of these &#8212; it lives in object storage.</span></p><p><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">titles </span><span data-color="rgb(67, 67, 67)" style="color: rgb(67, 67, 67);">table &#8212; catalog metadata</span></p><p><span>title_id, title, description, genres[], cast[], director,</span></p><p><span>release_year, rating, available_regions[], duration_seconds,</span></p><p><span>thumbnail_url, created_at, updated_at</span></p><p><span>Sharded by </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">title_id</span><span>. Regional availability (</span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">available_regions[]</span><span>) drives catalog filtering &#8212; a subscriber in Germany sees a different catalog than one in the US because Netflix licenses content per territory.</span></p><p><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">content_assets </span><span data-color="rgb(67, 67, 67)" style="color: rgb(67, 67, 67);">table &#8212; encoded renditions index</span></p><p><span>content_id, title_id, rendition_type (4K/1080p/720p/480p/360p),</span></p><p><span>codec (H264/H265/AV1), bitrate_kbps, file_size_bytes,</span></p><p><span>storage_uri (S3 path), manifest_uri, duration_seconds,</span></p><p><span>encoding_status (pending/processing/ready), created_at</span></p><p style="text-align: justify;"><span>The </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">manifest_uri </span><span>points to the HLS or DASH manifest file in S3 &#8212; the index of all segments for this rendition. When the player starts playback, it downloads the manifest first, then requests individual segments.</span></p><p><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">playback_sessions </span><span data-color="rgb(67, 67, 67)" style="color: rgb(67, 67, 67);">table &#8212; active and recent sessions </span><span>session_id, user_id, content_id, device_type, started_at,</span></p><p><span>last_heartbeat_at, current_position_seconds, current_quality,</span></p><p><span>total_play_time_seconds, rebuffer_count, total_rebuffer_seconds</span></p><p><span>Not stored in your OLTP database. High-frequency writes (heartbeat every 30 seconds, 50M concurrent sessions = ~1.7M writes/sec). Use Cassandra or a time-series store. Partition by </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">user_id </span><span>so &#8220;resume where I left off&#8221; is a single-partition read. Short TTL &#8212; you only need the last 30 days of session data for analytics; older data goes to cold storage.</span></p><p><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">user_watch_history </span><span data-color="rgb(67, 67, 67)" style="color: rgb(67, 67, 67);">&#8212; resume position and completion </span><span>user_id, title_id, content_id, position_seconds, completed (boolean), watched_at, device_type</span></p><p><span>This is what powers &#8220;continue watching.&#8221; Separate from the playback session &#8212; a session is live, watch history is the permanent record. Partition by </span><span data-color="rgb(24, 128, 56)" style="color: rgb(24, 128, 56);">user_id</span><span>.</span></p><p><span data-color="rgb(67, 67, 67)" style="color: rgb(67, 67, 67);">CDN content index &#8212; not a database table</span></p><p><span>The CDN&#8217;s internal index of what content is cached at which edge location. You don&#8217;t design this &#8212; it&#8217;s the CDN&#8217;s internal state. What you do design is the </span><strong><span>pre-positioning logic</span></strong><span>: before a major content release (new season of a hit show), Netflix pre-pushes the encoded files to CDN edge servers before playback demand arrives. This is called </span><strong><span>content pre-warming </span></strong><span>and it is one of the most important operational patterns in the whole system.</span></p><div class="callout-block" data-callout="true"><p><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">Preparing for a distributed systems interview?</span><br><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">&#8594;</span><a href="https://systemdrd.com/ebooks/sdcourse-distributed-systems-interview">Download the free Interview Pack</a><br><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">&#8594; </span><a href="https://systemdr.systemdrd.com/subscribe">Subscribe</a><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);"> now to access source code repository - 200 + coding lessons</span></p></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-netflix-streaming-the-senior">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[CAP Theorem: What It Actually Means in an Interview]]></title><description><![CDATA[CAP theorem is one of the most cited concepts in system design interviews and one of the most consistently misapplied.]]></description><link>https://systemdr.systemdrd.com/p/cap-theorem-what-it-actually-means</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/cap-theorem-what-it-actually-means</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 28 Jun 2026 03:30:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!BCp6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>CAP theorem is one of the most cited concepts in system design interviews and one of the most consistently misapplied.</p><p>The standard failure mode: a candidate mentions CAP theorem as a vocabulary signal (&#8221;we need to think about the CAP trade-off here&#8221;), states the three letters (Consistency, Availability, Partition tolerance), and moves on without connecting it to a concrete decision.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>The interviewer writes &#8220;mentioned CAP but couldn&#8217;t apply it.&#8221; The round continues.</p><p>Here&#8217;s what applying it actually looks like.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BCp6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BCp6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 424w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 848w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 1272w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BCp6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png" width="1456" height="856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:856,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:779742,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198937089?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BCp6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 424w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 848w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 1272w, https://substackcdn.com/image/fetch/$s_!BCp6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0e9faf1-9cfd-4567-bff5-384ec310be38_4675x2750.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>What CAP actually says</strong></p><p>CAP theorem says: in the presence of a network partition &#8212; when some nodes in your distributed system can&#8217;t communicate with others &#8212; you must choose between consistency and availability. You cannot have both.</p><p><em>Consistency</em> here means: every read returns the most recent write, or an error. Every node agrees on the current state.</p><p><em>Availability</em> means: every request gets a response. It may not be the most recent data, but the system doesn&#8217;t error or time out.</p><p><em>Partition tolerance</em> isn&#8217;t a choice &#8212; it&#8217;s a given. If you&#8217;re building a distributed system that runs over a real network, partitions happen. Network cables fail. Datacenters lose connectivity. You cannot opt out of partition tolerance. The real choice is always: when a partition happens, do you stay consistent or available?</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Payments Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Payments Walkthrough</span></a></p><p><strong>Where it actually matters</strong></p><p>The question is rarely &#8220;should I build a CP or AP system?&#8221; That&#8217;s too abstract to be useful. The useful version is: for <em>this specific read</em>, how stale can the data be before it causes a real problem?</p><p>Some reads tolerate stale data completely. Your Twitter follower count being one minute stale costs nothing. Your Netflix streaming recommendation being 24 hours stale costs nothing. These are candidates for eventual consistency &#8212; replicate async, serve locally, accept a brief window of inconsistency.</p><p>Some reads cannot tolerate stale data. Your bank account balance must be accurate before a payment is authorized. Your ticket reservation must be current before a seat is sold. These require strong consistency &#8212; at the cost of higher latency and potential availability loss during a partition.</p><p>The L5 answer isn&#8217;t &#8220;I&#8217;ll use eventual consistency.&#8221; It&#8217;s: &#8220;For the timeline read, I&#8217;ll accept eventual consistency &#8212; a post appearing 30 seconds late costs nothing. For the payment authorization, I need strong consistency &#8212; an incorrect balance check is a real financial loss. These two paths use different consistency models within the same system.&#8221;</p><p><strong>PACELC: the extension worth knowing</strong></p><p>CAP only talks about partition scenarios. PACELC extends the model to the normal case: even without a partition, there&#8217;s a trade-off between latency and consistency. If you want every read to reflect the latest write, you need to coordinate across replicas &#8212; which adds latency. If you serve from the nearest replica without coordination, you have lower latency but possible stale reads.</p><p>Knowing PACELC by name is a mild L6 signal. More importantly, understanding that the consistency/latency trade-off exists even on sunny days is what matters.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ufc7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ufc7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 424w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 848w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 1272w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ufc7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png" width="1456" height="841" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:841,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:958688,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198937089?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ufc7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 424w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 848w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 1272w, https://substackcdn.com/image/fetch/$s_!Ufc7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9801ff2-eb55-43be-a9d1-86c9c5ad7a82_4950x2860.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The three decisions CAP drives in practice</strong></p><p>When you reach the data model step in a design interview, CAP should inform exactly three things:</p><p><em>Replication strategy.</em> Synchronous replication (every write waits for all replicas to confirm) gives strong consistency at the cost of write latency. Asynchronous replication (write confirms when the leader writes, replicas catch up later) gives lower write latency but a brief consistency window.</p><p><em>Read routing.</em> If you route reads to the leader only, you always get the latest data. If you route reads to any replica, you get lower latency but potentially stale data. Pick based on what each read is for.</p><p><em>Conflict resolution.</em> When two nodes accept writes for the same key during a partition, you have a conflict. Last-writer-wins, vector clocks, CRDTs, operational transforms &#8212; each is a different answer to the same CAP-induced conflict problem.</p><p>The engineers who use CAP well in interviews don&#8217;t mention it as a signal. They use it as a decision tool. &#8220;For the payment authorization read, I need consistency over availability &#8212; I&#8217;ll route to the leader and accept higher latency.&#8221; That sentence is CAP applied correctly. It doesn&#8217;t require saying &#8220;CAP&#8221; at all.</p><div><hr></div><p><strong>CTA:</strong> The Stripe Payments walkthrough (paid post #2) covers the consistency decisions in a payment system end-to-end &#8212; exactly where strong consistency is required, exactly where eventual is acceptable, and why.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Design WhatsApp — The Senior+ Walkthrough]]></title><description><![CDATA[This is the question that defines the real-time messaging archetype.]]></description><link>https://systemdr.systemdrd.com/p/design-whatsapp-the-senior-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-whatsapp-the-senior-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 23 Jun 2026 03:31:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!WJKt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dea1b8-ed5c-460e-8728-796ec0b725f8_2048x1240.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>This is the question that defines the real-time messaging archetype. Ten questions in the question bank are variants of it &#8212; Slack, Discord, Zoom, Twitter Spaces, iMessage, Facebook Messenger, Google Chat. They share a spine: a long-lived connection problem, a delivery semantics problem, and a presence problem. Get fluent with all three and you can answer any messaging interview you&#8217;re handed.</p></blockquote><blockquote><p>The surface question looks simple: two people want to send each other messages. The probe underneath is anything but. Interviewers use this question because it exposes how candidates think about distributed systems under failure &#8212; specifically what happens when the recipient is offline, when the network drops mid-message, when the same message arrives twice, and when a user has five devices. Those four failure modes, and your response to them, are where the round is decided.</p></blockquote><blockquote><p>For L4 / mid-level: the basic chat flow and message storage. For L5 / senior: delivery semantics under unreliable networks (at-most-once, at-least-once, exactly-once), presence at scale, and offline message handling. For L6 / staff: the multi-device consistency model, group message fan-out at WhatsApp&#8217;s scale (2 billion users), end-to-end encryption architecture, and what happens when a message is delivered to 256 group members across 12 time zones while half of them are offline.</p></blockquote><div><hr></div><h2>The Question</h2><blockquote><p>&#8220;Design WhatsApp. Users should be able to send messages to each other in real time. Messages should be delivered even when the recipient is temporarily offline.&#8221;</p></blockquote><p>Common variants:</p><ul><li><p>&#8220;Design Facebook Messenger.&#8221;</p></li><li><p>&#8220;Design iMessage / Apple Messages.&#8221;</p></li><li><p>&#8220;Design Slack&#8217;s messaging core.&#8221;</p></li><li><p>&#8220;Design a real-time chat system.&#8221;</p></li><li><p>&#8220;Design the messaging layer for [our product].&#8221;</p></li></ul><p>All five are the same architecture. Slack adds channels and threads; the delivery model is identical. iMessage adds end-to-end encryption; the transport is identical. Discord adds voice and server-based channels; the one-to-one messaging core is identical.</p><div><hr></div><h2>Step 1 &#8212; Clarify Before You Draw</h2><p>Six questions. Two of them are load-bearing for the entire design.</p><p><strong>1. One-to-one only, or also group chats?</strong> One-to-one is the simpler problem. Group chats add fan-out &#8212; sending one message to N recipients &#8212; which at WhatsApp&#8217;s scale means up to 256 recipients per group. State which you&#8217;re designing for. For L5+: design for both, but start with one-to-one and explicitly extend.</p><p><strong>2. What are the delivery guarantees?</strong> This is the load-bearing question. Three options:</p><ul><li><p><em>At-most-once:</em> messages might be lost but never duplicated. Fine for ephemeral signals (typing indicators). Terrible for chat.</p></li><li><p><em>At-least-once:</em> messages are definitely delivered but might be delivered more than once. The receiver handles deduplication. Acceptable for most chat systems.</p></li><li><p><em>Exactly-once:</em> messages are delivered exactly once, regardless of retries. Theoretically ideal. In practice, you can approximate it with idempotency keys and deduplication at the receiver &#8212; but you cannot achieve it perfectly across an unreliable network. Saying &#8220;exactly-once is impossible in a distributed system&#8221; out loud is a senior signal.</p></li></ul><p>WhatsApp and most production systems implement at-least-once delivery with client-side deduplication. State this explicitly.</p><p><strong>3. What devices does each user have?</strong> Multiple devices per user (phone, tablet, web, desktop) massively complicates the model. A message sent to a user needs to land on all their active devices. On which device does the &#8220;read receipt&#8221; trigger? Clarify this early.</p><p><strong>4. Offline handling &#8212; how long do you store messages for an offline recipient?</strong> If a recipient is offline for 30 days, do their messages accumulate on your servers? Most production systems store for 30 days and drop after that (with notification to sender). Clarify the retention window.</p><p><strong>5. End-to-end encryption?</strong> E2EE (like WhatsApp&#8217;s Signal Protocol implementation) means the server cannot read message content &#8212; it only stores encrypted ciphertext and routing metadata. This changes the data model significantly. State whether you&#8217;re designing with E2EE or not. For L5: acknowledge it exists and where it fits. For L6+: explain the key exchange flow.</p><p><strong>6. What scale?</strong> 2 billion monthly active users is WhatsApp&#8217;s actual scale. For the interview, pick a working number: 500M DAU, 100 billion messages per day (WhatsApp&#8217;s reported figure as of its scale). These numbers drive your storage and throughput estimates.</p><div><hr></div><h2>Step 2 &#8212; Estimate</h2><p>Working assumptions:</p><ul><li><p>500M daily active users</p></li><li><p>100 billion messages per day = ~1.16 million messages per second average, ~5M/sec peak</p></li><li><p>Average message size: 100 bytes (text only), 500 bytes with metadata</p></li><li><p>30-day message retention for offline recipients</p></li><li><p>1 billion messages stored at any moment (roughly 1% of daily volume is &#8220;pending delivery&#8221;)</p></li><li><p>Media (images, video, voice): handle separately via object storage (S3 / CDN pre-signed URLs); only metadata and a pointer lives in the chat system</p></li></ul><p>Storage for messages: 100B messages/day &#215; 500 bytes &#215; 30 days retention &#8776; 1.5 PB. This is your &#8220;hot&#8221; storage &#8212; messages waiting to be delivered or recently delivered. After 30 days, messages drop off the hot store. Delivered messages can be stored client-side and expunged from the server (this is exactly what WhatsApp does &#8212; server deletes after delivery confirmation).</p><p>Connection state: 500M users &#215; ~30% concurrently connected = ~150M concurrent WebSocket connections. At 64KB per connection socket buffer that&#8217;s roughly 9.6 TB of connection memory across your fleet. This is one of the hardest scaling problems in messaging &#8212; the number of open connections.</p><p>Write throughput: 1.16M messages/sec average into a message store. This rules out single-node anything. You need a distributed message queue and a sharded persistence layer.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p><div><hr></div><h2>Step 3 &#8212; API Design</h2><p>Four endpoints. The real-time delivery is not REST &#8212; it&#8217;s a persistent connection.</p><p>WebSocket: wss://chat.whatsapp.com/connect</p><p>Auth:    Bearer token in Upgrade request headers</p><p>Purpose: The long-lived connection for receiving messages and sending keep-alives. All message delivery happens here.</p><p>On connect: server sends any pending (undelivered) messages accumulated while the client was offline.</p><div class="callout-block" data-callout="true"><p>POST /v1/messages/send</p><p>  Idempotency-Key: &lt;client-generated UUID&gt;     &#8592; THE PROBE</p><p>  Body: {</p><p>    to_user_id: string,</p><p>    message_id: string,        (client-generated, for dedup)</p><p>    content_encrypted: bytes,  (ciphertext if E2EE)</p><p>    content_type: &#8220;text&#8221; | &#8220;image&#8221; | &#8220;audio&#8221; | &#8220;video&#8221;,</p><p>    media_url: string,         (pre-uploaded, optional)</p><p>    client_timestamp: epoch_ms</p><p>  }</p><p>  Response: {</p><p>    message_id: string,</p><p>    server_timestamp: epoch_ms,</p><p>    status: &#8220;queued&#8221; | &#8220;delivered&#8221;</p><p>  }</p><p>POST /v1/messages/ack</p><p>  Body: { message_id: string, ack_type: &#8220;delivered&#8221; | &#8220;read&#8221; }</p><p>  Purpose: Explicit delivery and read acknowledgment from client.</p><p>           Server relays read receipts back to sender.</p><p>GET /v1/users/:user_id/presence</p><p>  Response: { status: &#8220;online&#8221; | &#8220;offline&#8221; | &#8220;last_seen_at&#8221;: timestamp }</p><p>  Note: WhatsApp makes presence opt-out &#8212; users can hide last seen.</p><p>        This is a privacy setting, not a system constraint.</p></div><p><strong>The senior move on the API step:</strong> Name the Idempotency-Key and message_id in the same breath. The message_id is client-generated before the send &#8212; if the client retries because it didn&#8217;t receive an ack, the server detects the duplicate via message_id and does not re-queue. The Idempotency-Key is the HTTP-level dedup. Both are necessary: the HTTP key handles transport-level retries, the message_id handles application-level deduplication across devices and reconnections.</p><p>Saying that distinction out loud &#8212; <em>two levels of deduplication for two different failure modes</em> &#8212; is the L6 signal on this question.</p><div class="callout-block" data-callout="true"><p>Subscribe now to <br>&#8594;unlock complete system design walkthroughs<br>&#8594; Get access to downloadable Drill Cards and full walkthrough</p></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-whatsapp-the-senior-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Scoping Discipline — Why Engineers Design Too Much]]></title><description><![CDATA[Learn System Design with System building, Subscribe Hands On coding course - LogStream]]></description><link>https://systemdr.systemdrd.com/p/the-scoping-discipline</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-scoping-discipline</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 21 Jun 2026 03:30:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ife-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><p>Learn <strong>System Design with System building, Subscribe Hands On coding course - <a href="https://sdcourse.substack.com/p/start-here-how-to-use-sdcourse">LogStream</a></strong></p></div><p>There&#8217;s a version of the system design interview where the candidate designs Twitter. The entire Twitter. Timeline, search, notifications, recommendations, ads, analytics, direct messages.</p><p>At the 40-minute mark they&#8217;re still drawing boxes. They haven&#8217;t gone deep on anything. The interviewer writes &#8220;breadth over depth, no clear prioritization&#8221; on the scorecard.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>This is the most common failure mode among technically strong candidates, and it has nothing to do with technical knowledge. It&#8217;s a scoping problem.</p><p>Here&#8217;s the discipline that fixes it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ife-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ife-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 424w, https://substackcdn.com/image/fetch/$s_!ife-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 848w, https://substackcdn.com/image/fetch/$s_!ife-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 1272w, https://substackcdn.com/image/fetch/$s_!ife-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ife-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png" width="1456" height="777" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:777,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:708052,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936747?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ife-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 424w, https://substackcdn.com/image/fetch/$s_!ife-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 848w, https://substackcdn.com/image/fetch/$s_!ife-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 1272w, https://substackcdn.com/image/fetch/$s_!ife-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7371b8-858e-4ccf-ba1a-8cfdfe2246dc_4950x2640.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The negotiation in the first five minutes</strong></p><p>Most candidates use the first five minutes to ask clarifying questions. How many users? What&#8217;s the read:write ratio? Does this need global availability?</p><p>These are fine questions. They&#8217;re also generic &#8212; they could be asked for any question. They don&#8217;t signal to the interviewer that you understand how to manage scope.</p><p>The candidates who score well on problem scoping don&#8217;t just ask questions. They propose scope.</p><p>&#8220;There are several interesting subsystems here: the timeline, search, notifications, the recommendation algorithm, and the ad serving layer. I&#8217;m going to focus on the timeline and the fan-out architecture. I&#8217;ll acknowledge the others exist and sketch where they&#8217;d connect, but I won&#8217;t design them in detail. Does that direction work for you?&#8221;</p><p>This is different from asking questions. You&#8217;re proposing what you&#8217;re going to design and explicitly not design, and you&#8217;re inviting the interviewer to redirect if they want something different.</p><p>Most interviewers will say yes. Some will redirect you: &#8220;Actually, I&#8217;m more interested in the fan-out problem for group chats specifically.&#8221; This is useful information you would not have gotten without proposing scope first.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for WhatsApp Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for WhatsApp Walkthrough</span></a></p><p><strong>Why the pressure to cover everything exists</strong></p><p>The instinct to design everything is understandable. The interview is evaluating your technical breadth, right? If you only design one component, won&#8217;t the interviewer think you don&#8217;t know the rest?</p><p>This misunderstands what the interview is evaluating.</p><p>Interviewers at L5+ levels are not checking whether you&#8217;ve memorized the architecture for every subsystem of Twitter. They know you&#8217;re familiar with notifications and search &#8212; you work as a software engineer. What they can&#8217;t infer from your resume is whether you can identify the hardest distributed systems problem in a question, scope down to it, and go deep enough to demonstrate real understanding.</p><p>Designing eight systems shallowly proves you&#8217;re familiar with eight systems. Designing one system deeply proves you can think through the hard parts of a complex problem. The second is what they&#8217;re scoring.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SRqC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SRqC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 424w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 848w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 1272w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SRqC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png" width="1456" height="760" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:760,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:836881,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936747?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SRqC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 424w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 848w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 1272w, https://substackcdn.com/image/fetch/$s_!SRqC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984fa789-42fd-4484-a4da-f8cb0ff050a2_5060x2640.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>How to choose what to scope in</strong></p><p>The right component to go deep on is the component with the most interesting distributed systems problem. Not the component you know best. Not the component that feels safest. The component where the answer is genuinely non-obvious.</p><p>For Twitter: the fan-out problem is more interesting than the user profile service. The timeline cache architecture is more interesting than the follow/unfollow API. Go where the hard problem lives.</p><p>A useful test: which component, if I described it at a surface level, would the interviewer immediately probe deeper on? That&#8217;s the component to start with.</p><p><strong>What to do with the components you&#8217;re not designing</strong></p><p>You don&#8217;t ignore them. You acknowledge them.</p><p>&#8220;Notifications would follow a standard fan-out-on-write pattern with push to APNs/FCM for mobile and WebSocket for web, similar to what we discussed for the timeline. I&#8217;m not going to design it in detail, but the interesting problem there is the delivery guarantee under failure &#8212; we&#8217;d need at-least-once delivery with client-side dedup.&#8221;</p><p>One sentence that shows you understand the problem, the standard solution, and the interesting edge case &#8212; without spending five minutes on a full design. This signals breadth without consuming depth time.</p><p><strong>The specific framing that works</strong></p><p>After the estimation section, before drawing anything, say this out loud:</p><p>&#8220;Before I draw the architecture, I want to lock scope. I&#8217;m going to go deep on [component X] because that&#8217;s where the interesting distributed systems problem is. I&#8217;ll acknowledge [components Y and Z] exist and show where they connect, but I won&#8217;t design them fully unless you&#8217;d like me to. Does that work?&#8221;</p><p>The explicit scope lock serves two purposes. It sets expectations so the interviewer isn&#8217;t waiting for you to cover components you&#8217;ve already decided to skip. And it gives the interviewer one last opportunity to redirect before you&#8217;ve committed 30 minutes to the wrong area.</p><p>After this moment, the scope is locked. Don&#8217;t drift. If you finish the deep dive early, go deeper on the component you chose &#8212; don&#8217;t add new components to fill time.</p><p><strong>The uncomfortable truth about breadth</strong></p><p>Demonstrating breadth is valuable. Demonstrating it through shallow coverage of many components is not the right way.</p><p>The right way: show breadth through the quality of your acknowledgments. When you mention a component you&#8217;re not designing and you correctly name the problem it has and the standard approach for solving it, you&#8217;ve shown breadth in one sentence. Compare that to spending five minutes on a shallow design of the same component &#8212; same signal, five minutes cheaper.</p><p>Scope discipline isn&#8217;t about knowing less. It&#8217;s about deploying what you know efficiently enough to demonstrate depth where it matters.</p><div><hr></div><p><strong>CTA:</strong> Tuesday&#8217;s paid post is the full WhatsApp walkthrough &#8212; including how to scope it correctly when the question says &#8220;design a messaging system&#8221; and you have 50 minutes. </p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><p><strong>Curious how this works in real systems?</strong> </p><p>The paid lessons cover scalability, optimization, and real-world engineering patterns.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Design Uber Dispatch — The Senior+ Walkthrough]]></title><description><![CDATA[This is the question that defines the marketplace and matching archetype.]]></description><link>https://systemdr.systemdrd.com/p/design-uber-dispatch-the-senior-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-uber-dispatch-the-senior-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 16 Jun 2026 03:30:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!X5Su!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94c092b-6e6d-42a4-906c-81bdd893ef09_2048x1341.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>This is the question that defines the marketplace and matching archetype. Ten questions in the question bank are variants of it &#8212; DoorDash delivery, Airbnb booking, Tinder matching, parking reservation, surge pricing, ride-share fraud. They share a spine: a supply side, a demand side, a location component, and a real-time matching requirement. The architecture that works for Uber dispatch, with minimal modification, works for all ten.</p></blockquote><blockquote><p>The surface question &#8212; &#8220;design Uber&#8221; &#8212; is a 4-hour answer. Interviewers narrow it deliberately: &#8220;design the dispatch system,&#8221; &#8220;design how a driver gets matched to a rider,&#8221; &#8220;walk me through what happens between the rider hitting &#8216;Request&#8217; and the driver getting a notification.&#8221; All three collapse to the same probe: <strong>how do you find the nearest available supply in real time, at scale, without burning down your database on every request?</strong></p></blockquote><p>The answer involves a data structure most candidates haven&#8217;t touched since their algorithms course: geospatial indexing. Specifically, quadtrees or geohashing &#8212; and knowing <em>which one</em> and <em>why</em> is the senior signal.</p><p>For L4 / mid-level: describe the matching flow and a naive approach. For L5 / senior: articulate the geospatial indexing choice with its trade-offs. For L6 / staff: the consistency model across supply/demand state, the surge pricing data flow, multi-city scaling, and what happens when a driver&#8217;s GPS signal drops.</p><div><hr></div><h2>The Question</h2><blockquote><p>&#8220;Design the Uber dispatch system. A rider requests a ride. The system finds nearby available drivers and assigns one to the rider.&#8221;</p></blockquote><p>Common variants:</p><ul><li><p>&#8220;Design DoorDash / UberEats food delivery dispatch.&#8221;</p></li><li><p>&#8220;Design Lyft&#8217;s matching system.&#8221;</p></li><li><p>&#8220;Design a system to match drivers to delivery orders in real time.&#8221;</p></li><li><p>&#8220;Design the driver-to-rider matching at Uber.&#8221;</p></li></ul><p>All four are the same architecture. DoorDash has one additional dimension &#8212; the restaurant (a fixed supply point instead of a moving one) &#8212; but the matching logic is identical.</p><div><hr></div><h2>Step 1 &#8212; Clarify Before You Draw</h2><p>Six questions. Two of them are load-bearing for the whole design.</p><p><strong>1. What does &#8220;dispatch&#8221; include &#8212; match only, or also route and surge?</strong> Dispatch in the narrow sense is &#8220;find a driver and assign them to a rider.&#8221; Routing (which road to take) is a separate system (Google Maps API or in-house). Surge pricing (dynamic fare) is another separate system. Clarify scope explicitly. Design the matching layer; acknowledge the others exist.</p><p><strong>2. How many active drivers? What&#8217;s the geography &#8212; one city or global?</strong> Active drivers in a single city: tens of thousands. Globally: millions. This shapes whether your geo-index fits in memory on one machine or needs distribution. For a US metro at peak, 10,000&#8211;50,000 active drivers is a reasonable working number. Global scale: 5&#8211;10M.</p><p><strong>3. How frequently do drivers update their location?</strong> Every 4&#8211;5 seconds is typical. This is a high-frequency write stream &#8212; 50,000 drivers &#215; 1 write/4s = ~12,500 writes/sec in one busy metro. Globally: millions of writes/sec. State this number; it drives the design of the location ingestion layer.</p><p><strong>4. What&#8217;s the matching latency SLO?</strong> A rider hits &#8220;request&#8221; and expects a driver to accept within 30&#8211;60 seconds. The matching decision itself should happen in milliseconds &#8212; sub-100ms for the initial candidate selection. If it takes 5 seconds to find a candidate, the experience breaks.</p><p><strong>5. Can a driver be matched to multiple requests simultaneously?</strong> No &#8212; a driver has one state: available or not. This is the consistency problem at the heart of the question. Two riders cannot be dispatched to the same driver. The system that manages this state is load-bearing.</p><p><strong>6. What failure modes matter most?</strong> Driver goes offline mid-trip. GPS signal drops. Driver declines the match. Rider cancels after match. Each one requires a state machine transition. State the three most important ones out loud.</p><div><hr></div><h2>Step 2 &#8212; Estimate</h2><p>Working assumptions for a single large metro deployment:</p><ul><li><p>50,000 active drivers at peak</p></li><li><p>200,000 ride requests per hour at peak = ~55 ride requests/sec</p></li><li><p>Driver location update: every 4 seconds, so 50,000 / 4 = 12,500 location writes/sec</p></li><li><p>Matching query: for every ride request, find all drivers within ~2 km radius</p></li><li><p>Average matching candidate set: 20&#8211;50 drivers</p></li><li><p>End-to-end dispatch latency target: &lt; 100ms for candidate selection, &lt; 30s for driver acceptance</p></li></ul><p>Location data per driver per update: ~100 bytes (driver_id, lat/lng, timestamp, status).</p><p>Writes: 12,500/s &#215; 100 bytes &#8776; 1.25 MB/s. Trivial for a single machine.</p><p>If global (5M drivers): 5M / 4 = 1.25M writes/sec. Serious &#8212; needs distributed location ingestion. But for this walkthrough, start with the single-metro case and note the global extension.</p><p>The geo-index in memory for 50,000 drivers: 50,000 &#215; 100 bytes = 5 MB. <em>Fits entirely in memory on a single machine.</em> This insight &#8212; that the active driver set for one city is tiny &#8212; is what enables the in-memory geo-index approach.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p><div><hr></div><h2>Step 3 &#8212; API Design</h2><p>Three endpoints. The first is rider-facing, the second is driver-facing, the third is the internal matching call.</p><div class="callout-block" data-callout="true"><p>POST /v1/rides/request</p><p>Headers:</p><p>  Authorization: Bearer {rider_token}</p><p>Body:</p><p>  pickup_lat: float</p><p>  pickup_lng: float</p><p>  destination_lat: float</p><p>  destination_lng: float</p><p>  ride_type: &#8220;uberx&#8221; | &#8220;pool&#8221; | &#8220;xl&#8221; | &#8220;black&#8221;</p><p>Response:</p><p>  ride_id: &#8220;r_xxx&#8221;</p><p>  status: &#8220;searching&#8221;</p><p>  eta_to_pickup_seconds: integer (estimate, not a promise)</p><p>  price_estimate: { low_cents, high_cents, surge_multiplier }</p><p>PUT /v1/drivers/location</p><p>Headers:</p><p>  Authorization: Bearer {driver_token}</p><p>Body:</p><p>  lat: float</p><p>  lng: float</p><p>  heading: float (degrees)</p><p>  speed_mps: float (meters/sec)</p><p>  status: &#8220;available&#8221; | &#8220;on_trip&#8221; | &#8220;offline&#8221;</p><p>Response: 200 (ack)</p><p>POST /v1/dispatch/match   (internal, not public-facing)</p><p>Body:</p><p>  ride_id: &#8220;r_xxx&#8221;</p><p>  pickup_lat, pickup_lng</p><p>  ride_type</p><p>Response:</p><p>  candidate_drivers: [{ driver_id, distance_meters, eta_seconds, rating }]</p></div><p><strong>The senior move on location updates:</strong> note that the driver app batches and sends at 4-second intervals, not on every GPS tick (which might be 1-second intervals). Batching reduces write load by 4x and extends driver battery life. Saying this out loud &#8212; that the <em>client</em> has a role in write amplification &#8212; is an insight most candidates miss.</p><p><strong>heading and speed_mps</strong> in the location update. Junior candidates send only lat/lng. Senior candidates send velocity vector too. Why: ETA estimation to a pickup point requires knowing not just where the driver is but which way they&#8217;re going and how fast. A driver 500m away facing the wrong direction on a one-way street is further than a driver 700m away pointed at you. The heading/speed fields feed the ETA model.</p><div><hr></div><h2>Step 4 &#8212; Data Model</h2><p>Four stores. The geo-index is the unusual one.</p><h3>drivers table &#8212; source of truth for driver state</h3><p>driver_id, name, vehicle_type, license_plate, rating_avg, total_trips,</p><p>current_status (ENUM: available/on_trip/offline/suspended),</p><p>current_lat, current_lng, last_location_update, created_at</p><p>Sharded by driver_id. The current_status and current_lat/lng columns are updated frequently &#8212; this is the consistency-critical state. More on that in Step 6.</p><h3>rides table &#8212; the ride state machine</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KsEo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KsEo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 424w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 848w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 1272w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KsEo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png" width="1157" height="457" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:457,&quot;width&quot;:1157,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84112,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/201697493?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KsEo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 424w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 848w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 1272w, https://substackcdn.com/image/fetch/$s_!KsEo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696dbad-e66d-47bd-ad8e-b5ed032c76da_1157x457.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UHAO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UHAO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 424w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 848w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 1272w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UHAO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png" width="862" height="345" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:345,&quot;width&quot;:862,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41337,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/201697493?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UHAO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 424w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 848w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 1272w, https://substackcdn.com/image/fetch/$s_!UHAO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F493fdbf1-f3d3-4f15-b030-a33635aad5a0_862x345.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Ride state machine:</strong> searching &#8594; matched (driver found) &#8594; accepted (driver acknowledged) &#8594; driver_en_route &#8594; arrived &#8594; in_progress &#8594; completed | cancelled</p><p>Any state can transition to cancelled. The driver_id is only set at the matched transition. If a driver declines, status reverts to searching and the matching process re-runs.</p><h3>location_history &#8212; time series store</h3><p>Not your OLTP database. Location events are time-series data: (driver_id, lat, lng, timestamp, heading, speed). At 12,500 events/sec, that&#8217;s 1 billion events/day in one metro. You don&#8217;t store this in Postgres. You use a time-series database (InfluxDB, TimescaleDB, Cassandra with a time-ordered key) or push to a data lake for analytics.</p><p>The hot query (&#8221;where is this driver right now?&#8221;) hits the geo-index, not this table. This table is for analytics, replay, and dispute resolution (&#8221;I was at X at time T &#8212; prove it&#8221;).</p><h3>driver_geo_index &#8212; the in-memory geo-index</h3><p>This is the heart of the system. Not a SQL table. An in-memory spatial index that answers &#8220;which drivers are within radius R of point (lat, lng) in sub-millisecond time.&#8221;</p><p>Two real options: <strong>quadtrees</strong> or <strong>geohashing</strong>. This is Step 6&#8217;s deep dive.</p><div class="callout-block" data-callout="true"><p>Preparing for a distributed systems interview?<br>&#8594;<a href="https://systemdrd.com/ebooks/sdcourse-distributed-systems-interview">Download the free Interview Pack</a><br>&#8594; <a href="https://systemdr.systemdrd.com/subscribe">Subscribe</a> now to access source code repository - 200 + coding lessons</p></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-uber-dispatch-the-senior-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Question Every FAANG Loop Asks. You Probably Haven't Drilled It.]]></title><description><![CDATA[Learn System Design with System building, Subscribe Hands On coding course - LogStream]]></description><link>https://systemdr.systemdrd.com/p/the-same-10-questions-hiding-behind</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-same-10-questions-hiding-behind</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 14 Jun 2026 03:30:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JQAU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><p>Learn <strong>System Design with System building, Subscribe Hands On coding course - <a href="https://sdcourse.substack.com/p/start-here-how-to-use-sdcourse">LogStream</a></strong></p></div><p>There are 52 questions in the FAANG system design question bank. Engineers preparing for FAANG-tier interviews often drill them one by one: design Twitter, then design Uber, then design WhatsApp, then design Stripe.</p><p>This is the wrong approach. Not because the questions don&#8217;t matter &#8212; they do. But because drilling 52 individual questions treats each one as unique when most of them are the same question with a different surface.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Here&#8217;s what I mean.</p><p><strong>The 10 underlying problems</strong></p><p>Every system design question is fundamentally an instance of one or more of these:</p><p><em>Fan-out under load</em> &#8212; how do you efficiently deliver one write to many readers? Twitter&#8217;s feed, Instagram&#8217;s feed, TikTok&#8217;s feed, Slack&#8217;s channel messages, notifications. All the same problem. The celebrity/large-group edge case appears in all of them.</p><p><em>Inventory reservation</em> &#8212; how do you prevent two users from claiming the same unit simultaneously? Airbnb&#8217;s booking, ticket booking, parking lot reservation. All the same atomic-claim-under-contention problem. The same <code>FOR UPDATE SKIP LOCKED</code> pattern solves all three.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JQAU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JQAU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 424w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 848w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 1272w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JQAU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png" width="1456" height="856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:856,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:707122,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JQAU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 424w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 848w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 1272w, https://substackcdn.com/image/fetch/$s_!JQAU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad370b07-b22e-499c-ad0e-354c8c40aba2_4675x2750.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Question Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Question Walkthrough</span></a></p><p><em>Delivery semantics under failure</em> &#8212; what happens when the network drops in the middle of a message delivery? WhatsApp, Slack, notification services, task queues. All wrestling with at-least-once vs exactly-once and the FLP impossibility argument.</p><p><em>Geospatial proximity</em> &#8212; how do you efficiently find nearby things in real time? Uber&#8217;s driver matching, Yelp&#8217;s restaurant search, Tinder&#8217;s candidate discovery, DoorDash&#8217;s Dasher assignment. Geohashing or quadtrees. Same index. Different shape of data.</p><p><em>Time-series at scale</em> &#8212; how do you store and query data that&#8217;s ordered by time and written at massive volume? Metrics monitoring, log aggregation, ride history, payment history. Same write-optimized, rollup-tiered architecture.</p><p><em>Pre-computation vs on-demand</em> &#8212; when do you compute the answer at write time vs query time? Feed ranking, typeahead, recommendation engines. Same trade-off: store more, compute less per query.</p><p><em>Adaptive delivery</em> &#8212; how do you serve the right quality given uncertain network conditions? Netflix streaming, Spotify, live video, file transfer. Same ABR pattern. Different media format.</p><p><em>Content-addressed storage</em> &#8212; how do you store large binary objects efficiently across millions of users? Dropbox, iCloud Photos, any file storage product. Same chunking, hashing, deduplication pattern.</p><p><em>Global rate control</em> &#8212; how do you enforce a limit across a distributed fleet of servers? Rate limiters, budget pacing in ad systems, quota enforcement. Same sliding window counter in Redis.</p><p><em>Fraud via relationship patterns</em> &#8212; how do you detect bad actors whose individual actions look legitimate? Payment fraud, ride-share fraud, ad click fraud. Same two-layer architecture: streaming rules for velocity, graph analysis for network patterns.</p><p><strong>What this changes about preparation</strong></p><p>Once you see the underlying patterns, the preparation strategy changes.</p><p>Instead of drilling 52 individual questions, drill 10 problem types. When you understand fan-out deeply &#8212; the write amplification, the celebrity threshold, the hybrid approach &#8212; you can answer Twitter&#8217;s timeline, Instagram&#8217;s feed, TikTok&#8217;s FYF, and Slack&#8217;s channels as variants of the same problem. The surface details change. The architecture doesn&#8217;t.</p><p>This is why the question bank is organized by archetype, not by company. Twitter&#8217;s timeline is filed under &#8220;Social Feed&#8221; alongside Instagram, TikTok, and Reddit. Uber is filed under &#8220;Marketplace &amp; Matching&#8221; alongside Airbnb, Tinder, and DoorDash. The point is to make the pattern visible.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EJp_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EJp_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 424w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 848w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 1272w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EJp_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png" width="1456" height="1257" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1257,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1445437,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EJp_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 424w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 848w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 1272w, https://substackcdn.com/image/fetch/$s_!EJp_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9d71421-fa17-481f-a6f7-0c929d75c65b_5225x4510.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The test you can run right now</strong></p><p>Take any two questions from your preparation list. Can you identify the one or two underlying patterns they share? If yes, drilling one deeply makes the other easier. If no &#8212; reply to this post and I&#8217;ll map it for you.</p><p>The engineers who consistently pass at L5 and L6 don&#8217;t have 52 memorized answers. They have 10 deeply understood patterns and the ability to apply them to a question they haven&#8217;t seen before.</p><p>That second skill is what the interview is actually testing.</p><div><hr></div><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer. </p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong> </p></div><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><p><strong>Want the complete learning path?</strong></p><p>Unlock advanced modules, case studies, and guided exercises.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Design Twitter's Timeline — The Senior+ Walkthrough]]></title><description><![CDATA[This is the question that defines the social feed archetype.]]></description><link>https://systemdr.systemdrd.com/p/design-twitters-timeline-the-senior</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-twitters-timeline-the-senior</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 09 Jun 2026 03:30:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2dyu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb3096da-0f8e-42d2-b5ff-dddbabf33e41_1950x2048.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is the question that defines the social feed archetype. Twelve questions in the FAANG question bank are variants of this one &#8212; Instagram feed, TikTok For You, Reddit front page, LinkedIn news feed, Pinterest home, YouTube next-up, Stories, trending topics. They share a backbone: many users, many posts, a feed that has to be both fresh and ranked, and a write/read ratio that decides the entire architecture. If you internalize Twitter timeline, you can answer eleven other questions you haven&#8217;t drilled.</p><blockquote><p>The version most interviewers ask is not &#8220;design Twitter&#8221; &#8212; that&#8217;s a 4-hour question. They ask &#8220;design the Twitter home timeline&#8221; or &#8220;design the news feed for [our product]&#8221; or &#8220;design the part of [X] that shows posts from people you follow.&#8221; All of these collapse to the same probe: <strong>how do you serve a feed for a user whose followed set has wildly variable size and post rate, while keeping the feed fresh?</strong></p></blockquote><blockquote><p>For L4 / mid-level the bar is articulating one approach (fanout-on-write) and walking it cleanly. For L5 / senior, the probe is the trade-off between fanout-on-write and fanout-on-read, and the realization that production systems do <em>both</em> depending on the user. For L6 / staff, the probe is hot-user handling, ranking, and the operational story for a system that ingests millions of writes per second and serves billions of feed reads.</p></blockquote><div><hr></div><h2>The Question</h2><blockquote><p>&#8220;Design the Twitter home timeline. A user opens the app and sees a feed of recent posts from the people they follow, sorted appropriately. Posts can be original tweets, retweets, or replies.&#8221;</p></blockquote><p>Common variants:</p><ul><li><p>&#8220;Design Instagram&#8217;s feed.&#8221;</p></li><li><p>&#8220;Design Facebook News Feed.&#8221;</p></li><li><p>&#8220;Design the LinkedIn home page.&#8221;</p></li><li><p>&#8220;Design Reddit&#8217;s front page.&#8221;</p></li><li><p>&#8220;Design the TikTok For You feed.&#8221;</p></li></ul><p>The first four are direct equivalents. TikTok For You is <em>almost</em> the same &#8212; but with one critical difference: it&#8217;s not a follow-graph feed, it&#8217;s a recommendation feed. The architecture is similar; the candidate generation is different. Note this if asked.</p><div><hr></div><h2>Step 1 &#8212; Clarify Before You Draw</h2><p>Six questions. The first three matter most.</p><p><strong>1. Are we ranking or just chronological?</strong> Old Twitter was reverse-chronological. Modern Twitter is ranked. This is the single biggest variable. Chronological is far simpler &#8212; sort by timestamp, done. Ranked introduces a scoring system, a feature pipeline, and probably an ML model. State which one you&#8217;re designing for explicitly. If unclear, design ranked &#8212; it&#8217;s the harder and more realistic version.</p><p><strong>2. What&#8217;s the active user count? What&#8217;s the average follow count? What&#8217;s the maximum?</strong> The numbers determine the architecture. 100M daily active users with average follow count 200 looks different from 500M DAU with average follow count 500. The maximum follow count is the more decisive number &#8212; it&#8217;s the long-tail celebrity problem in disguise. State explicit numbers.</p><p><strong>3. What&#8217;s the read-to-write ratio?</strong> Always lopsided in social feeds, but how lopsided matters. 100:1 means you have lots of writes; 1000:1 means you can afford to do work on the write path. State the ratio; it justifies fanout-on-write later.</p><p><strong>4. How fresh? Real-time, or 5-minute staleness OK?</strong> Real-time means push. Stale-OK means pull or hybrid. Most production feeds tolerate seconds-to-minutes of staleness; saying &#8220;I&#8217;d target 5-second p99 freshness&#8221; is a senior signal.</p><p><strong>5. What goes in the feed besides original posts?</strong> Retweets count as posts, generally. Replies usually don&#8217;t appear in the home timeline by default (only on the conversation thread). Trending topics, ads, suggested follows, &#8220;in case you missed it&#8221; pulls &#8212; all of these are <em>injected</em> into the feed in production. Acknowledge this exists; don&#8217;t try to design it all.</p><p><strong>6. What&#8217;s the SLO for feed load?</strong> Typical: p50 &lt; 200ms, p99 &lt; 500ms for the API. The user opens the app and the timeline has to be there. State the number; it drives caching.</p><div><hr></div><h2>Step 2 &#8212; Estimate</h2><p>Working assumptions for the rest of this walkthrough:</p><ul><li><p>500M daily active users (DAU)</p></li><li><p>Each user reads their feed ~5 times/day on average &#8594; 2.5B feed reads/day &#8594; ~30K reads/sec average, peaking at 200K</p></li><li><p>Each user posts ~0.2 times/day on average &#8594; 100M posts/day &#8594; ~1,200 posts/sec average, peaks at ~10K</p></li><li><p>Average follow count: 200 (median is much lower; mean is dragged up by power users)</p></li><li><p>Maximum follow count: 5,000 (for normal users; verified accounts can exceed)</p></li><li><p>Maximum <em>follower</em> count: 100M+ (for celebrities &#8212; this is the asymmetry that breaks naive designs)</p></li><li><p>Posts retained in timelines: roughly 1,000 per user (older items can be paginated in on demand)</p></li></ul><p>Storage:</p><ul><li><p>Posts table: 100M posts/day &#215; 365 days &#215; 5 years &#215; 1 KB &#8776; 180 TB</p></li><li><p>Timeline cache (precomputed timelines): 500M users &#215; 1,000 posts &#215; 200 bytes/entry &#8776; 100 TB</p></li><li><p>Follow graph: hundreds of billions of edges, but each edge is small (~30 bytes) &#8594; ~3-5 TB</p></li></ul><p>The timeline cache is the unusual one. It&#8217;s bigger than your hot OLTP and lives in a different system (typically Redis, Memcached, or a custom in-memory store). When a senior candidate names this layer separately from the posts store, you know they&#8217;ve built something like this.</p><p>Read bandwidth:</p><ul><li><p>200K reads/sec &#215; 1,000 timeline entries &#215; 200 bytes &#8776; 40 GB/s</p></li><li><p>This is what the timeline cache absorbs &#8212; the posts table never sees this traffic.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p><div><hr></div><h2>Step 3 &#8212; API Design</h2><p>Three endpoints. The first one is the headline.</p><div class="callout-block" data-callout="true"><p>GET /v1/timeline/home</p><p>Query:</p><p>  cursor: string (optional, for pagination)</p><p>  limit: integer (default 20, max 100)</p><p>Response:</p><p>  posts: [array of post objects]</p><p>  next_cursor: string or null</p><p>  ranked_at: timestamp (when this version was ranked)</p><p>POST /v1/posts</p><p>Body:</p><p>  content: string (max 280 chars or whatever your limit is)</p><p>  media_ids: [array of pre-uploaded media references]</p><p>  reply_to_post_id: optional</p><p>  Idempotency-Key: header</p><p>Response:</p><p>  id, created_at, author_id</p><p>POST /v1/follow</p><p>Body:</p><p>  target_user_id: string</p><p>Response:</p><p>  follow_id, created_at</p></div><p><strong>Pagination is cursor-based, not offset-based.</strong> Offset (page=3, per_page=20) is broken at scale because the data shifts beneath you &#8212; by the time you fetch page 3, new posts have arrived and pushed everything down. Cursors (an opaque token encoding a position in the feed) are immune to this. Saying <em>&#8220;cursor-based, never offset-based for feeds&#8221;</em> is a senior signal.</p><p><strong>ranked_at</strong> in the response is the time the timeline was scored. Useful for client-side caching (&#8221;don&#8217;t re-fetch for 30 seconds&#8221;) and for debugging staleness reports. Most candidates omit this. Including it is a small but real senior tell.</p><div class="callout-block" data-callout="true"><p>Subscribe now to <br>&#8594;unlock complete system design walkthroughs<br>&#8594; Get access to downloadable Drill Cards and full walkthrough</p></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-twitters-timeline-the-senior">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[L4, L5, L6, L7 — What Actually Changes Between Levels]]></title><description><![CDATA[Learn System Design with System building, Subscribe Hands On coding course - LogStream]]></description><link>https://systemdr.systemdrd.com/p/l4-l5-l6-l7-what-actually-changes</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/l4-l5-l6-l7-what-actually-changes</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 07 Jun 2026 02:48:48 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!5Yib!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><p>Learn <strong>System Design with System building, Subscribe Hands On coding course - <a href="https://sdcourse.substack.com/p/start-here-how-to-use-sdcourse">LogStream</a></strong></p></div><p></p><p>Most engineers preparing for senior-level interviews have a vague sense that &#8220;L6 answers go deeper.&#8221; This is both true and useless as preparation advice. Deeper in what direction? Deeper by how much? What specifically changes?</p><p>refer basics <a href="https://systemdr.systemdrd.com/p/load-balancing-101-how-traffic-gets">here - load balancing 101</a>  - </p><p>Here is what specifically changes.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p><strong>L4 &#8594; L5: from &#8220;what&#8221; to &#8220;why&#8221;</strong></p><p>An L4 answer describes the architecture. An L5 answer defends it.</p><p>At L4, the bar is: can you run a framework, estimate sensibly, and produce a coherent design with read and write paths? That&#8217;s it. Interviewers are checking whether you know the building blocks.</p><p>At L5, the bar is: can you justify your decisions? When the interviewer asks &#8220;why did you partition by recipient_id instead of sender_id?&#8221;, the L4 candidate says &#8220;that&#8217;s the standard approach.&#8221; The L5 candidate says &#8220;because the hot query is &#8216;give me all pending messages for user X&#8217; &#8212; partitioning on the read pattern means that query hits one shard. If I partitioned by sender, delivering to user X requires querying every node.&#8221;</p><p>The transition from L4 to L5 is the transition from &#8220;stating decisions&#8221; to &#8220;reasoning about decisions.&#8221; Same architecture. Different explanation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Yib!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Yib!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 424w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 848w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 1272w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Yib!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png" width="1456" height="844" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:844,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:945218,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936263?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5Yib!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 424w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 848w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 1272w, https://substackcdn.com/image/fetch/$s_!5Yib!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fa0d1da-16f1-4680-9a26-52679241d836_5500x3190.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Question Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Question Walkthrough</span></a></p><p><strong>L5 &#8594; L6: from design to operation</strong></p><p>An L5 answer designs a system that works. An L6 answer designs a system that works <em>and</em> describes how you&#8217;d know if it was failing.</p><p>L6 adds three things that L5 almost never has:</p><p><em>SLOs with monitoring signals.</em> Not &#8220;the API should be fast.&#8221; &#8220;I&#8217;m targeting p99 &lt; 100ms for the feed read. The metric I&#8217;d alert on is cache hit ratio dropping below 90% &#8212; that&#8217;s the leading indicator that Postgres load is about to spike.&#8221;</p><p><em>Failure modes named and partially addressed.</em> Not &#8220;we&#8217;d add monitoring.&#8221; &#8220;The failure mode here is the thundering herd when the Redis node recovers &#8212; if we don&#8217;t add jitter to the retry, every failed request retries simultaneously and we bring Redis down again the moment it comes back up.&#8221;</p><p><em>The operational reality of trade-offs.</em> L5 says &#8220;consistent hashing handles node failure gracefully.&#8221; L6 says &#8220;consistent hashing with virtual nodes handles it, but I&#8217;d still want an active health check every 5 seconds and a circuit breaker so that if a node is responding slowly rather than failing hard, we stop routing to it before the tail latency affects users.&#8221;</p><p>The transition from L5 to L6 is the transition from &#8220;designing for the happy path&#8221; to &#8220;designing for the failure path.&#8221;</p><p><strong>L6 &#8594; L7: from system to organization</strong></p><p>L7 is the level where the interview stops being about a single system and starts being about the relationship between systems &#8212; and the teams that build them.</p><p>L7 adds:</p><p><em>Build vs buy decisions with economic reasoning.</em> Not &#8220;we&#8217;d use Kafka.&#8221; &#8220;For this use case, Kafka is the right call &#8212; the producers and consumers have different scale characteristics and we want replay capability. But if we&#8217;re a 20-person company, the operational overhead of Kafka is probably not worth it; I&#8217;d use SQS and revisit when the team can support it.&#8221;</p><p><em>Organizational implications.</em> &#8220;This architecture creates a hard dependency between the payments team and the notifications team. I&#8217;d extract the notification contract into a shared schema owned by a platform team to prevent that coupling from slowing down both teams&#8217; deploy cadence.&#8221;</p><p><em>Platform thinking.</em> Not &#8220;how do I build this feature&#8221; but &#8220;how do I build this such that 10 teams can build features on top of it without coordinating with me.&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q8Ju!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q8Ju!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q8Ju!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:984924,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198936263?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!q8Ju!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!q8Ju!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95231af2-836d-47da-b1b5-86fd1632c0a4_5500x3080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The pattern</strong></p><p>Each level adds a <em>type</em> of thinking, not just more of the same thinking.</p><p>L4: knows the vocabulary. L5: can reason about trade-offs. L6: thinks about failure, operations, and monitoring. L7: thinks about organizations, economics, and platforms.</p><p>If you&#8217;re targeting L5, make sure you can answer &#8220;why did you make that choice?&#8221; for every major decision. That&#8217;s the bar.</p><p>If you&#8217;re targeting L6, make sure every design decision has three parts: what you chose, why you chose it, and what would change your mind.</p><p>If you&#8217;re targeting L7, make sure you can talk about one decision in terms of its organizational and economic implications &#8212; not just its technical ones.</p><p><strong>Paid subscribers get a full system design walkthrough every Tuesday. </strong></p><p><strong>This week: Stripe Payments &#8212; the idempotency key problem most engineers miss.</strong></p><div><hr></div><p>The paid posts go deeper on the Senior vs Staff distinction for each specific question &#8212; here&#8217;s what the L5 answer looks like, here&#8217;s what L6 adds, here&#8217;s the exact phrasing that signals each. </p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><p><strong>Want the complete learning path?</strong> </p><p>Unlock advanced modules, case studies, and guided exercises.</p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Design Stripe Payments — The Senior+ Walkthrough]]></title><description><![CDATA[Subscribe Now..]]></description><link>https://systemdr.systemdrd.com/p/design-stripe-payments-the-senior</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-stripe-payments-the-senior</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 02 Jun 2026 03:31:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bctk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a21a344-0661-43eb-991b-190f9d3d22ec_4800x2700.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><p style="text-align: justify;"><a href="https://systemdr.systemdrd.com/subscribe">Subscribe Now</a>.. Here&#8217;s what&#8217;s included:</p><p>&#8594; Every Tuesday paid walkthrough &#8212; one full named-question answer every week, calibrated to L4&#8211;L7. 52 posts per year.</p><p>&#8594; All drill cards &#8212; single-page PDFs for each question, designed to be re-read the morning of your interview</p><p>&#8594; The full paid archive &#8212; every walkthrough ever published, available immediately</p><p>&#8594; Framework cheatsheets &#8212; estimation numbers, API design patterns, trade-off communication, scaling decisions</p><p>&#8594; Discord community &#8212; #ask-the-author, mock interview partners, #offers-landed</p></div><blockquote><p style="text-align: justify;">This is the question that filters senior from staff in money-movement loops. The surface of the question &#8212; &#8220;design a payments processor&#8221; &#8212; looks ordinary. The probe underneath is one of the few places in system design interviews where being wrong has audit-trail consequences in production. Interviewers know this, which means they don&#8217;t accept the kind of hand-waving that flies on a feed-design question. You either understand idempotency, ledgers, and double-entry, or you don&#8217;t. The answer reveals it within five minutes.</p></blockquote><p>If you are interviewing at Stripe, Block, Adyen, PayPal, Robinhood, Coinbase, or any fintech doing real money movement &#8212; this is the question. If you&#8217;re at FAANG-tier companies whose products handle payments (Amazon, Apple, Google), expect a variant. The frame is always the same: a customer initiates a payment, the system has to debit one party and credit another, and <em>every single step </em>has to be reconcilable, retryable, and auditable.</p><p>For L4 / mid-level the bar is the surface design. For L5 / senior, the probe is idempotency keys and the retry semantics around them. For L6 / staff, the probe is the ledger, double-entry consistency, and what happens when the upstream bank says yes-then-no.</p><p>The Question</p><blockquote><p>&#8220;Design a payment processing service like Stripe. Customers (merchants) integrate your API to charge their end-users&#8217; credit cards. The service handles the full flow: take card details, authorize the charge with the card network, settle the funds, and notify the merchant of the outcome.&#8221;</p></blockquote><p>The question is rarely asked exactly this way. Common variants:</p><blockquote><p>- &#8220;Design the core payment flow at a payments processor.&#8221;</p><p>- &#8220;Design a system to process credit card charges.&#8221;</p><p>- &#8220;How would you build the part of Stripe that charges a card?&#8221;</p><p>- &#8220;Walk me through what happens between stripe.charges.create() and money landing in the merchant&#8217;s account.&#8221;</p></blockquote><p>All four are the same question. Don&#8217;t be thrown by the framing.</p><h3>Step 1 &#8212; Clarify Before You Draw</h3><p>Five questions before you draw anything. Each one is loaded.</p><p><strong>1. Synchronous or asynchronous API? </strong>The merchant calls your endpoint and waits &#8212; <em>or </em>&#8212; the merchant gets a 202 Accepted and a webhook later? This single question determines half the architecture. Synchronous means your API call blocks on the card network round-trip (200ms&#8211;2s of bank latency on the hot path). Asynchronous means you queue the work and notify via webhook. Most production processors offer both modes; the synchronous mode is what merchants reach for first because it&#8217;s easier to integrate.</p><p><strong>2. What payment instruments? Cards only, or also bank transfers, wallets, and BNPL? </strong>Pin this down. Cards only is a different design from &#8220;any payment method.&#8221; Cards have card networks (Visa/Mastercard/Amex). Bank transfers go through ACH (US), SEPA (EU), UPI (India), and have settlement windows of hours to days. BNPL (Klarna/Afterpay) involves a credit decision. <em>Scope to cards for the core walkthrough; mention that a real system extends to other rails.</em></p><p><strong>3. Are we issuing the cards, or just accepting them? </strong>Issuing cards (like Stripe Issuing or Cash App&#8217;s debit card) is a totally different system &#8212; you&#8217;re now responsible for card production, fraud on outbound spend, and chargebacks against your own balance. Accepting is what Stripe Payments does and what most candidates mean. Confirm scope explicitly.</p><p><strong>4. Single currency or multi-currency? </strong>Multi-currency adds an FX layer, which adds rate-locking semantics (&#8221;the customer saw $20, but settle in EUR at what rate?&#8221;) and accounting complexity. Most candidates assume USD-only. State the assumption out loud.</p><p><strong>5. What&#8217;s the SLO? </strong>Payment APIs typically target p99 &lt; 500ms for the synchronous flow. <em>And </em>99.99% availability &#8212; payments are revenue, downtime is direct loss for every merchant on the platform. State both numbers explicitly. They drive every later decision.</p><p>If you ask all five, you&#8217;ve already separated yourself from 80% of candidates. Most jump to drawing.</p><h3>Step 2 &#8212; Estimate</h3><p>Working assumptions for the rest of this walkthrough:</p><ul><li><p>10,000 transactions per second at peak. (Stripe processes more than this; pick a number</p></li><li><p>with a buffer.)</p></li><li><p>- 100 million transactions per day average; 500 million on peak shopping days.</p></li><li><p>- Average ticket: $50. So daily payment volume ~$5B at average, ~$25B at peak.</p></li><li><p>- 99.99% availability target = 52 minutes of downtime allowed per year.</p></li><li><p>- p99 latency target: 500ms for the synchronous charge endpoint.</p></li></ul><p>Storage:</p><p>- Each transaction record is roughly 2 KB after enrichment.</p><p>- 100M/day &#215; 365 = 36.5B transactions/year &#215; 2 KB = ~73 TB/year.</p><p>- Retention: 7 years for financial records (PCI/regulatory). 7 &#215; 73 = ~500 TB total.</p><p>This is <em>big </em>but not unprecedented. The implication: your transactional store is sharded relational (Postgres, Spanner, CockroachDB) and your archive is cold object storage with a hot/warm/cold tier. You won&#8217;t keep 7 years in your hot OLTP path.</p><p>Network: 10K tps &#215; 2 KB = 20 MB/s. Trivial.</p><p>External dependencies &#8212; this is the unusual one for this question. You&#8217;re round-tripping to:</p><p>- Card networks (Visa, Mastercard) for authorization. ~200ms typical, can spike to 2s.</p><p>- Acquiring banks for settlement. Async; settlement is a batch process.</p><p>- Issuer banks for fraud signals. Sometimes inline, sometimes async.</p><p>- Fraud / risk services (could be in-house or external like Sift). ~50ms inline.</p><p>- Webhook delivery to merchants. Async, fire-and-forget with retry.</p><p></p><p>The interviewer will probe this list. Knowing the names of these systems is what separates a senior who has thought about payments from a candidate who&#8217;s read one blog post.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHuB Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHuB Repo</span></a></p><h3>Step 3 &#8212; API Design</h3><p>Three endpoints. The first one is where the round is decided.</p><div class="callout-block" data-callout="true"><p>POST /v1/charges</p><p>Headers:</p><p>Authorization: Bearer sk_live_xxx</p><p>Idempotency-Key: &lt;client-generated UUID&gt; &#8592; THIS LINE IS THE PROBE</p><p>Body:</p><p>amount: integer (cents &#8212; never floats for money)</p><p>currency: string (ISO 4217: &#8220;usd&#8221;, &#8220;eur&#8221;)</p><p>source: string (tokenized card reference, e.g., &#8220;tok_xxx&#8221;)</p><p>description: string (optional)</p><p>metadata: object (merchant-defined)</p><p>Response: 200</p><p>id: &#8220;ch_xxx&#8221;</p><p>amount, currency, status: &#8220;succeeded&#8221; | &#8220;failed&#8221; | &#8220;pending&#8221;</p><p>outcome: { network_status, risk_level, seller_message }</p><p>GET /v1/charges/:id</p><p>Returns the current state of the charge. Idempotent by definition (HTTP GET).</p><p>POST /v1/refunds</p><p>Body:</p><p>charge_id: &#8220;ch_xxx&#8221;</p><p>amount: integer (defaults to full charge amount)</p><p>Idempotency-Key: &lt;client-generated UUID&gt;</p><p>Returns: { id: &#8220;re_xxx&#8221;, amount, status }</p></div><p><strong>The senior move on this step: </strong>name the Idempotency-Key header out loud and explain why it&#8217;s there. Say something like: <em>&#8220;Charging a card is the highest-stakes API call most companies ever make. Network failures, retries, double-clicks &#8212; all of these can cause the merchant&#8217;s code to call our endpoint twice with the same intent. We have to detect that and return the cached response instead of charging twice. This is what the Idempotency-Key header does.&#8221;</em></p><p>If you say that sentence in a Stripe interview, you&#8217;ve passed the first probe. If you don&#8217;t mention</p><p>idempotency by minute 10 of this question, you fail at minute 30 when the interviewer asks:</p><p>&#8220;What happens if the merchant&#8217;s code retries this call?&#8221;</p><p><strong>Use integer cents, not floats. </strong>I&#8217;m calling it out because every junior candidate reaches for float for currency. Floating-point math has rounding errors. $0.10 + $0.20 &#8800; $0.30 in IEEE 754. In production this causes accounting drift that takes weeks to find. Integer cents (or smaller &#8212; Stripe internally uses millicents for some flows) is the only correct answer. Saying this out loud is another senior signal.</p><h3>Step 4 &#8212; Data Model</h3><p>The OLTP record for the API call. Optimized for point lookups by id and by idempotency key.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i15y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i15y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 424w, https://substackcdn.com/image/fetch/$s_!i15y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 848w, https://substackcdn.com/image/fetch/$s_!i15y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 1272w, https://substackcdn.com/image/fetch/$s_!i15y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i15y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png" width="782" height="612" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:782,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71904,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/199698022?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i15y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 424w, https://substackcdn.com/image/fetch/$s_!i15y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 848w, https://substackcdn.com/image/fetch/$s_!i15y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 1272w, https://substackcdn.com/image/fetch/$s_!i15y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79d34cb4-2907-4f6f-b938-fc6ad24055a2_782x612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WbjB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WbjB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 424w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 848w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 1272w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WbjB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png" width="767" height="110" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:110,&quot;width&quot;:767,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24177,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/199698022?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WbjB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 424w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 848w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 1272w, https://substackcdn.com/image/fetch/$s_!WbjB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F700fd374-9bba-4a30-81ef-e21bb469aeec_767x110.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="callout-block" data-callout="true"><p><strong>Preparing for a distributed systems interview?</strong><br>&#8594;<strong><a href="https://systemdrd.com/ebooks/sdcourse-distributed-systems-interview">Download the free Interview Pack</a></strong><br><strong>&#8594; <a href="https://systemdr.systemdrd.com/subscribe">Subscribe</a> now to access source code repository - 200 + coding lessons</strong></p></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-stripe-payments-the-senior">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Consistent Hashing: Why It Matters and How It Works]]></title><description><![CDATA[There are two types of engineers who fail the distributed systems section of a design interview.]]></description><link>https://systemdr.systemdrd.com/p/consistent-hashing-why-it-matters</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/consistent-hashing-why-it-matters</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 31 May 2026 03:30:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NXk3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are two types of engineers who fail the distributed systems section of a design interview.</p><p>The first type doesn&#8217;t know what consistent hashing is. The second type knows the definition but can&#8217;t explain <em>why</em> modulo hashing fails or <em>what problem</em> consistent hashing actually solves.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>The second type fails more often. Knowing the name without the reasoning is worse than knowing nothing, because it telegraphs that you&#8217;ve memorized vocabulary rather than understood the underlying problem.</p><p>Here&#8217;s the underlying problem.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NXk3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NXk3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NXk3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:940155,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198935755?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NXk3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!NXk3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc36c2686-33e8-4ca0-97f8-4b19e7a92a36_5500x3080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The naive approach: modulo hashing</strong></p><p>You have 4 servers and a cache key. You run <code>hash(key) % 4</code> and get a server number. Simple. Fast. Evenly distributed.</p><p>Now one of your 4 servers dies. You have 3 servers. Every single key in the system now maps to a different server, because <code>hash(key) % 3</code> gives completely different results than <code>hash(key) % 4</code>.</p><p>Your cache hit rate drops to near zero. Every miss hits the database. Your database falls over. This is a real production incident pattern.</p><p>Same problem in reverse: you add a fifth server to handle load. Every key remaps. Every cache entry is now on the wrong server. The cache is empty until it warms up. If you&#8217;re adding a server because you&#8217;re under load, this is the worst possible time to invalidate your entire cache.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Question Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Question Walkthrough</span></a></p><p><strong>The consistent hashing solution</strong></p><p>Consistent hashing puts both servers and keys on an imaginary ring numbered 0 to 2&#179;&#178;. To find which server owns a key: hash the key, find its position on the ring, walk clockwise until you hit a server.</p><p>When a server is added or removed, only the keys between the new server and its predecessor on the ring need to move. For N servers, adding or removing one server moves approximately 1/N of the keys. Not all of them. 1/N.</p><p>That&#8217;s the entire point. The damage from topology changes is contained.</p><p><strong>Virtual nodes: the production detail</strong></p><p>Naive consistent hashing has a problem: if you hash 4 server IDs onto a ring, they won&#8217;t land evenly spaced. Some servers end up owning much more of the ring than others. When one server dies, all of its load dumps onto a single neighbor &#8212; the one clockwise from it.</p><p>Virtual nodes fix this. Instead of placing each server once on the ring, you place it 100&#8211;200 times (with different hash inputs like <code>server1-0</code>, <code>server1-1</code>, <code>server1-2</code>...). Each physical server now has 100&#8211;200 positions spread around the ring. Load is distributed evenly. When a server dies, its load spreads across every other server, not just one neighbor.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!43Nu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!43Nu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!43Nu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:933373,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198935755?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!43Nu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 424w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 848w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 1272w, https://substackcdn.com/image/fetch/$s_!43Nu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e9d4953-b38f-415f-b3db-2025e2f9edb4_5500x3080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Why this matters in an interview</strong></p><p>Consistent hashing shows up in at least 8 of the 52 most common system design questions: distributed caches, rate limiters, database sharding, CDN routing, load balancers, distributed file systems.</p><p>When you say &#8220;I&#8217;d shard by user ID&#8221; without specifying <em>how</em>, you&#8217;re leaving a gap the interviewer is likely to probe. When you say &#8220;I&#8217;d use consistent hashing with 150 virtual nodes per server to prevent the hot-neighbor problem on topology changes&#8221; &#8212; that&#8217;s the L5 signal for any infrastructure question.</p><p>The rule: anytime you&#8217;re distributing data across multiple nodes, consistent hashing is worth naming explicitly. Even if it&#8217;s not the exact implementation, mentioning it signals you understand that modulo hashing breaks under real operational conditions.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>&#8212;Sumedh</p><h4><strong>Want to explore this topic further?</strong> </h4><p>The paid version includes detailed walkthroughs, bonus resources, and hands-on exercises.</p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[ Design a URL Shortener]]></title><description><![CDATA[This is the question that gets butchered more than any other in system design prep.]]></description><link>https://systemdr.systemdrd.com/p/design-a-url-shortener</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-url-shortener</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 26 May 2026 03:31:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CNP5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>This is the question that gets butchered more than any other in system design prep. Most resources hand you a 5-minute toy answer suitable for a phone screen and call it done. In a real onsite, this question runs 50 to 60 minutes, and the interviewer is using it to probe at least four distinct skills: capacity reasoning, ID generation under distributed constraints, caching strategy, and your awareness of failure modes. Miss two of the four and you fail the round, regardless of how clean your boxes-and-arrows came out.</p></blockquote><p>This walkthrough is the senior version. If you are prepping for L4 / mid-level the bar is lower &#8212; you can stop after Step 5. For L5 / senior and L6 / staff, the deep dives are where the round is won or lost.</p><div><hr></div><h2>The Question</h2><blockquote><p>&#8220;Design a URL shortener service like bit.ly. The service takes a long URL and returns a shorter alias that, when accessed, redirects to the original.&#8221;</p></blockquote><p>This question turns up in essentially every system design loop &#8212; Amazon, Google, Twitter / X, Reddit, Stripe, Pinterest, and most Series B+ startups doing senior-and-up hires. It is popular because it is a bounded problem with multiple defensible architectures, which makes it a good lens on how you think rather than what you have memorized.</p><div><hr></div><h2>Step 1 &#8212; Clarify Before You Draw</h2><p>Three questions before you draw a single box. Ask these out loud, even if you think you can guess the answer. Spending ninety seconds here is what produces the senior signal.</p><p><strong>1. Read-to-write ratio?</strong> The almost-universal answer is somewhere between 100:1 and 1000:1. Most short URLs get clicked many more times than they get created. This number drives every caching decision later in the round, so you need it pinned down.</p><p><strong>2. Custom short codes allowed, or system-generated only?</strong> This question splits the design in half. System-generated only: you can use auto-incrementing IDs and have no collision problem at all. Custom codes allowed: you have a uniqueness check on every write, plus a hot-key problem because everyone wants short, memorable aliases like /sale or /promo.</p><p><strong>3. Analytics required? Click counts, geographic data, referrer tracking?</strong> If yes, this is no longer a key-value problem. It becomes a key-value problem plus an event pipeline plus an aggregation system. The interviewer is testing whether you spot that the analytics requirement reshapes the architecture.</p><p>A senior candidate writes the answers to these three questions on the whiteboard. A junior candidate skips this step, designs for the wrong assumptions, and has to restart twenty minutes in.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CNP5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CNP5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 424w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 848w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 1272w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CNP5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png" width="1456" height="1092" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1092,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1578009,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/199143482?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CNP5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 424w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 848w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 1272w, https://substackcdn.com/image/fetch/$s_!CNP5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93ea80c7-679e-4898-a21c-397643f35885_5500x4125.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Step 2 &#8212; Estimate</h2><p>Pick numbers that justify your architecture. Imprecision is fine; sloppiness is not.</p><p>Working assumptions for the rest of this walkthrough:</p><ul><li><p>100M new URLs created per month, which gives roughly 40 writes per second on average, with peaks 5 to 10x higher</p></li><li><p>100:1 read-to-write ratio, giving roughly 4,000 reads per second on average, with peaks above 40K</p></li><li><p>5-year retention horizon</p></li><li><p>Average record size: 100 bytes for the long URL, 7 bytes for the short code, plus metadata &#8212; call it 500 bytes per record</p></li></ul><p>Storage: 100M &#215; 12 &#215; 5 = 6 billion URLs over five years. At 500 bytes per record that is 3 TB. This fits comfortably on a single sharded relational database. You do not need anything exotic.</p><p>Bandwidth: 4,000 reads per second &#215; 500 bytes is about 2 MB/s of read traffic. Trivial.</p><p>The estimation is not decoration. You will reference these numbers four more times before the round ends &#8212; when you justify caching, when you justify sharding, when the interviewer asks &#8220;what if we 100x&#8217;d the traffic?&#8221; Every later trade-off comes back to these inputs.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get Access to GitHub Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to GitHub Repo</span></a></p>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-url-shortener">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[What Interviewers Actually Score in System Design Rounds]]></title><description><![CDATA[Every engineer who has failed a system design round and wanted to understand why has hit the same wall: the feedback is generic, vague, or nonexistent.]]></description><link>https://systemdr.systemdrd.com/p/what-interviewers-actually-score</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/what-interviewers-actually-score</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 24 May 2026 03:30:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RpZR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every engineer who has failed a system design round and wanted to understand why has hit the same wall: the feedback is generic, vague, or nonexistent.</p><p>&#8220;Didn&#8217;t demonstrate sufficient depth.&#8221; &#8220;Wanted to see stronger technical judgment.&#8221; &#8220;Good fundamentals but the design wasn&#8217;t production-ready.&#8221;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>None of these tell you what to fix. They&#8217;re descriptions of an outcome, not a diagnosis.</p><p>After building prep material for engineers targeting L4&#8211;L7 at FAANG-tier companies, I&#8217;ve spent a lot of time understanding what interviewers actually score &#8212; not what they say they score, not what the official rubric says, but what the scorecard entries look like in practice.</p><p>Here&#8217;s what I&#8217;ve found.</p><div><hr></div><h2>The scoring dimensions most engineers don&#8217;t know about</h2><p>The system design interview at most major tech companies is scored on 5&#8211;8 explicit dimensions. Two of them, almost everyone knows about:</p><p><strong>Technical correctness</strong> &#8212; did the candidate&#8217;s design actually solve the stated problem? Could it work in production?</p><p><strong>Depth</strong> &#8212; did the candidate go beyond the surface answer on at least one component?</p><p>The dimensions that separate candidates who barely pass from candidates who get &#8220;Strong Hire&#8221; are the ones most prep resources ignore:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Subscribe for Question Walkthrough&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://systemdr.systemdrd.com/subscribe"><span>Subscribe for Question Walkthrough</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RpZR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RpZR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 424w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 848w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 1272w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RpZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png" width="578" height="325.125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:578,&quot;bytes&quot;:557012,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198933214?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RpZR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 424w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 848w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 1272w, https://substackcdn.com/image/fetch/$s_!RpZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7ff6632-2ac7-49be-aafa-8fcf4e096dd0_4000x2250.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Problem scoping</strong></p><p>The interviewer is watching whether you negotiate the scope of the problem before you start designing. Not ask questions &#8212; <em>negotiate scope</em>.</p><p>There&#8217;s a difference between &#8220;what&#8217;s the expected scale?&#8221; (a question) and &#8220;I&#8217;m going to focus on the timeline and the fan-out architecture, acknowledge that notifications and search exist, and go deep on the hardest part &#8212; does that work for you?&#8221; (a negotiation).</p><p>Candidates who score well on this dimension don&#8217;t try to design everything. They explicitly choose what they&#8217;re designing and why, and they do this in the first 3&#8211;5 minutes.</p><p>Candidates who score poorly try to design everything and end up designing nothing deeply. The 50-minute interview is not enough time to produce depth across a system with the surface area of Twitter. Everyone who attempts it runs out of time before the interesting parts.</p><div><hr></div><p><strong>Communication clarity</strong></p><p>This dimension is scored throughout the round, not at any specific moment. The question: can the interviewer follow your reasoning in real time?</p><p>The failure mode is surprisingly common among technically strong candidates: they know what they&#8217;re building, but they don&#8217;t say it out loud. They draw boxes on the whiteboard and connect them with arrows, and the interviewer has to ask &#8220;why did you connect those two boxes?&#8221; to understand the design decision.</p><p>The fix is specific: every decision should be stated before it&#8217;s drawn. Not &#8220;here&#8217;s a Redis cache&#8221; while drawing &#8212; &#8220;I&#8217;m going to put a Redis cache in front of Postgres here because the read:write ratio is 100:1 and the hot read pattern is point lookups by user_id, which Redis handles well at sub-millisecond latency. So here&#8217;s the cache.&#8221; The decision, then the reasoning, then the diagram.</p><p>This sounds slow. It&#8217;s actually faster, because the interviewer is never confused about what you&#8217;re doing or why. Confusion is the time-killer, not explanation.</p><div><hr></div><p><strong>Operational maturity</strong></p><p>This is the dimension that most separates L5 from L6 scorecards.</p><p>An answer that lacks operational maturity designs a system that works on the happy path. Everything goes right. The database responds. The messages are delivered. The cache is warm.</p><p>An answer with operational maturity designs a system and then asks: <em>what happens when it breaks?</em></p><p>&#8220;The failure mode here is the thundering herd when the Redis node recovers. Without jitter on the retry logic, every request that failed during the outage retries simultaneously the moment Redis comes back. I&#8217;d add exponential backoff with &#177;20% jitter to spread the retry load.&#8221;</p><p>&#8220;I&#8217;m targeting p99 &lt; 100ms for the feed read. The leading indicator I&#8217;d alert on is cache hit ratio dropping below 90% &#8212; that tells me Postgres load is about to spike before users start feeling degraded latency.&#8221;</p><p>These additions take 30 seconds to say. They produce a measurable difference in how the round is scored.</p><div><hr></div><p><strong>Level calibration</strong></p><p>Interviewers are calibrating your answer against the level you&#8217;re being hired for. A brilliant answer that&#8217;s calibrated for L4 will not earn a Strong Hire at L6. An adequate answer calibrated correctly for L5 can earn a Hire at L5.</p><p>This is worth saying explicitly: you don&#8217;t need to demonstrate the maximum possible depth. You need to demonstrate the right depth for your level.</p><p>At L4, the bar is: run the framework correctly. Estimate. Design the read and write paths. Mention at least one deep dive.</p><p>At L5, the bar is: defend your decisions under probing. Name failure modes. Cover the hard part of the question &#8212; the thing that makes this question different from the trivial version.</p><p>At L6, the bar is: SLOs with monitoring signals. Cross-system trade-offs. Operational layer. The three things above, plus the &#8220;what would tell me this design is failing&#8221; for each major component.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DtIR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DtIR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 424w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 848w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 1272w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DtIR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png" width="546" height="307.125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/addcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:546,&quot;bytes&quot;:578846,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://systemdr.systemdrd.com/i/198933214?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DtIR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 424w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 848w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 1272w, https://substackcdn.com/image/fetch/$s_!DtIR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faddcc91e-7809-4056-99b9-14f8b1e58478_4000x2250.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Knowing your level and calibrating your answer to it is itself a scored dimension.</p><div><hr></div><h2>The one thing most guides don&#8217;t tell you</h2><p>The design round is not a knowledge test. It&#8217;s a judgment test.</p><p>Two candidates can produce completely different architectures for the same question and both get Strong Hire. Two candidates can produce very similar architectures and one gets Strong Hire while the other gets No Hire. The architecture is the medium. The judgment &#8212; in how you scope, how you communicate, how you reason under pressure, how you handle failure cases &#8212; is what&#8217;s being evaluated.</p><p>This changes how you should prepare.</p><p>Memorizing architectures is necessary. It&#8217;s not sufficient. The prep that moves the needle is timed practice under interview conditions, with feedback specifically on the four dimensions above &#8212; not just on whether your architecture was technically correct.</p><div><hr></div><p>Every Tuesday, this newsletter publishes one full named-question walkthrough: the exact answer that would earn a Hire signal at your target level, plus the follow-up probes interviewers actually use, plus the common mistakes that fail the round. It covers what the architecture is, why each decision was made, and what the interviewer is specifically looking for.</p><p>The first ten questions are published. </p><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p>The free archive has a question bank, the six-step framework cheatsheet, and the estimation numbers reference. All three are downloadable without a subscription.</p><p>&#8212; Sumedh </p><div class="callout-block" data-callout="true"><p>The Question Vault has all 52 walkthroughs organized by archetype &#8212; so you can see the pattern across questions, not just the surface answer.</p><p><strong>Access all 52 Quesstions <a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">here</a></strong></p></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">System Design Interview Roadmap is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>