<?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>Fri, 27 Nov 2026 10:32:26 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[Idempotency Keys: How Stripe Makes It Safe to Retry a Payment]]></title><description><![CDATA[Why "just retry" double-charges people, the four cases a key store must handle, and the backoff that goes with it]]></description><link>https://systemdr.systemdrd.com/p/idempotency-keys-how-stripe-makes</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/idempotency-keys-how-stripe-makes</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Thu, 26 Nov 2026 03:30:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!yIKj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The problem in one picture</h2><p>Your app sends "charge &#8377;500" to a payments API. The API charges the card. Then the response gets lost: a mobile network drops, a load balancer times out, a pod restarts. Your app sees an error.</p><p>Did the charge happen? Your app can't tell. If it gives up, the order may be paid but never shipped. If it retries, the customer may pay twice. Neither is acceptable when money moves.</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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yIKj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yIKj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yIKj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115583,&quot;alt&quot;:&quot;Same lost response, two outcomes. The key turns a dangerous retry into a safe replay.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Same lost response, two outcomes. The key turns a dangerous retry into a safe replay." title="Same lost response, two outcomes. The key turns a dangerous retry into a safe replay." srcset="https://substackcdn.com/image/fetch/$s_!yIKj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!yIKj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff34b917d-24c7-4abe-82ab-e4ea61520a43_1800x780.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Same lost response, two outcomes. The key turns a dangerous retry into a safe replay.</figcaption></figure></div><h2>Why "make it idempotent" is not enough</h2><p>An operation is idempotent if doing it twice has the same effect as doing it once. Some operations are naturally like that: "set the price to &#8377;799" or "delete order 42". Repeating them changes nothing.</p><p>"Charge &#8377;500" is not. Neither is "send an email", "add an item to the cart" or "create an order". Each repeat creates a new thing. For these, the server needs a way to recognise that a request is a repeat. That's what an idempotency key is: a unique ID the client generates once and sends with the original request and every retry.</p><h2>What Stripe actually does</h2><p>Stripe described this in <a href="https://stripe.com/blog/idempotency">Designing robust and predictable APIs with idempotency</a> (Brandur Leach, 2017), and the <a href="https://docs.stripe.com/api/idempotent_requests">API docs</a> spell out the rules:</p><ul><li><p>The client sends an <code>Idempotency-Key</code> header, and the docs suggest a V4 UUID. Keys can be up to 255 characters.</p></li><li><p>Stripe saves the <strong>status code and body</strong> of the first request made with a key, and later requests with the same key get that saved result, "including <code>500</code> errors".</p></li><li><p>If a retry reuses the key with <strong>different parameters</strong>, Stripe returns an error instead of guessing.</p></li><li><p>Keys can be removed once they are <strong>at least 24 hours old</strong>. After that, the same key counts as a new request.</p></li><li><p>Keys go on <code>POST</code> requests. <code>GET</code> and <code>DELETE</code> don't need them because they are already idempotent.</p></li></ul><p>Two details are easy to miss. First, replaying a saved 500 sounds odd, but it's the honest answer: the server can't be sure how far the failed attempt got, so it won't quietly try again under the same key. Second, a request that fails validation is not saved, so the client can fix it and retry with the same 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_!bn8n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bn8n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!bn8n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:143105,&quot;alt&quot;:&quot;The four cases every key store must handle. The \&quot;still running\&quot; case is the one most designs forget.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The four cases every key store must handle. The &quot;still running&quot; case is the one most designs forget." title="The four cases every key store must handle. The &quot;still running&quot; case is the one most designs forget." srcset="https://substackcdn.com/image/fetch/$s_!bn8n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!bn8n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c6d3fc8-0de8-4f09-95e5-0965f2aa7ec7_1800x780.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">The four cases every key store must handle. The "still running" case is the one most designs forget.</figcaption></figure></div><h2>The retry half of the story</h2><p>A key makes retries safe. It doesn't make them polite. The same Stripe post recommends <strong>exponential backoff</strong>: wait roughly 2^n units after the nth failure. It also recommends adding random <strong>jitter</strong> so a thousand clients that failed at the same moment don't all retry at the same moment.</p><p>Without jitter, a brief outage ends with a synchronised wave of retries that can knock the service over again.</p><h2>Building it yourself</h2><p>The server side is smaller than it sounds:</p><ol><li><p>On a request with a key, look it up in a store keyed by (account, key).</p></li><li><p>If it's new, insert it with status "in progress" in the same transaction that starts the work, so two concurrent retries can't both win.</p></li><li><p>When the work finishes, save the status code and response body against the key.</p></li><li><p>If the key exists and is finished, compare the parameters, then replay the saved response or return an error.</p></li><li><p>If the key exists and is still in progress, return a conflict and let the client back off.</p></li><li><p>Expire keys after a retention window that is longer than your longest retry policy.</p></li></ol><p>Step 2 is the one that matters. Checking "does this key exist?" and then inserting it in a separate step lets two racing retries both run the charge.</p><h2>How to choose in an interview</h2><p>Any time your design has a client retrying a write that creates something or moves money, say:</p><ul><li><p>Which operations are naturally idempotent and which need a key.</p></li><li><p>Who generates the key (the client, once per logical action, not once per attempt).</p></li><li><p>Where keys live, how long they're kept, and what happens on a concurrent duplicate.</p></li><li><p>The retry policy: backoff with jitter, and a cap.</p></li></ul><h2>Success criteria: check yourself</h2><p>For each, decide whether it needs an idempotency key:</p><ol><li><p><code>PUT /users/42/email</code> with a new email address.</p></li><li><p><code>POST /orders</code> from a checkout button that users double-tap.</p></li><li><p>A worker that consumes "send welcome email" messages from a queue that may deliver a message twice.</p></li></ol><p>You've got it if you said: (1) no, setting a value is already idempotent; (2) yes, the client creates one key per checkout attempt, so a double tap reuses it; (3) yes, use the message ID as the key and record it before or with the send, because "deliver at least once" queues will redeliver.</p><h2>Interview angle</h2><p>"We'll retry on failure" is an L4 answer. Adding idempotency keys with the concurrent-duplicate case handled is L5. Adding the retention window, backoff with jitter, and what you'd watch, such as the replay rate and the rate of different-params errors that reveal client bugs, is L6.</p><h2>Next up</h2><p>Next Thursday: <strong>Replication lag</strong>, why users sometimes can't see what they just saved, and how Facebook's TAO keeps it from happening to the person who wrote it.</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 Surge Pricing — Walkthrough]]></title><description><![CDATA[Archetype: Marketplace & Matching &#183; Asked at: Uber, DoorDash, Lyft]]></description><link>https://systemdr.systemdrd.com/p/design-surge-pricing-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-surge-pricing-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 24 Nov 2026 03:30:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zRIc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>Surge pricing is a real-time control system, not just a database lookup. The system must ingest supply and demand signals continuously, compute price multipliers per zone, and serve those multipliers to millions of clients &#8212; all within seconds of a demand spike.</p></blockquote><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">52 FAANG Question Vault</mark></strong> &#8212; Regular one time price $299 - <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Black Friday 50% OFF $149 </mark></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/system-design-roadmap-landing-page/">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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zRIc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zRIc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 424w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 848w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 1272w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zRIc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png" width="638" height="416.2774725274725" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:950,&quot;width&quot;:1456,&quot;resizeWidth&quot;:638,&quot;bytes&quot;:728247,&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/225140349?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.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_!zRIc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 424w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 848w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 1272w, https://substackcdn.com/image/fetch/$s_!zRIc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa322a58f-6db4-4b56-ac6b-621932f35bb2_4750x3100.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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>
          <a href="https://systemdr.systemdrd.com/p/design-surge-pricing-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[When to Take the L5 Offer vs Wait for L6]]></title><description><![CDATA[This is a question I get in some form almost every week.]]></description><link>https://systemdr.systemdrd.com/p/when-to-take-the-l5-offer-vs-wait-ac8</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/when-to-take-the-l5-offer-vs-wait-ac8</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 22 Nov 2026 03:31:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QEp0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>This is a question I get in some form almost every week. Usually it sounds like: &#8220;I have an L5 offer at SystemDr, Inc but I think I could get L6. Should I negotiate up or take it?&#8221;</p><p>The honest answer is: it depends on factors that most advice skips. Here&#8217;s the framework I actually use.</p></blockquote><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><h3><strong>The real question isn&#8217;t about the level</strong></h3><p>The question &#8220;should I take L5 or hold out for L6&#8221; is actually three separate questions:</p><ol><li><p>Are you currently performing at L6 in your current role?</p></li><li><p>Did the interview process give genuine signal that you&#8217;re close to L6?</p></li><li><p>What are the costs of waiting?</p></li></ol><p>Most people asking this question are only thinking about question 2. The other two matter as much.</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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QEp0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QEp0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 424w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 848w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QEp0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png" width="1456" height="809" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:809,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:522524,&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/224862483?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.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_!QEp0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 424w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 848w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!QEp0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd44b1de4-04f1-458c-8ce0-7a225ba03cfa_3600x2000.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h3><strong>Question 1: Are you currently performing at L6?</strong></h3><p>L6 at most FAANG companies means: you&#8217;re driving technical direction for a team or product area, your work has cross-team or cross-org impact, and your decisions have meaningful business consequences.</p><p>If you&#8217;re currently a Senior Engineer at a mid-stage startup making principally individual contributor decisions, you&#8217;re probably not there yet. Being smart enough for L6 and having the demonstrated track record for L6 are different things. The interview can assess the former; only experience develops the latter.</p><p>If you take an L5 role and perform at L6 within 12&#8211;18 months, you&#8217;ll be promoted. That&#8217;s the standard internal path and it&#8217;s not slow &#8212; at most major companies, an L5 who performs at L6 gets promoted at the next review cycle. The salary difference over 18 months is usually smaller than it looks.</p><h3><strong>Question 2: Did the interview give genuine L6 signal?</strong></h3><p>&#8220;The recruiter said I was close to L6&#8221; is not the same as genuine L6 signal.</p><p>Genuine L6 signal: the debrief feedback explicitly mentions L6 as a possible outcome, and the gaps cited are addressable with experience rather than skills you don&#8217;t have. &#8220;Strong L5, strong signals in operational maturity and cross-functional influence &#8212; could see L6 with more scope&#8221; is meaningful feedback.</p><p>&#8220;We&#8217;d love to revisit your level in the future&#8221; or &#8220;you&#8217;re one of our strongest L5s&#8221; is not L6 signal. It&#8217;s standard recruiter language.</p><p>If the feedback is vague and the recruiter is suggesting you could negotiate, the realistic outcome of pushing for L6 is either: the offer is rescinded (unlikely but not impossible), the level stays the same and you&#8217;ve burned goodwill, or they technically offer L6 but calibrate your starting equity and bonus expectations accordingly. The number changes less than the title.</p><h3><strong>Question 3: What are the costs of waiting?</strong></h3><p>Waiting means: declining this offer, preparing more, and attempting another loop at another company in 6&#8211;12 months.</p><p>The costs are real: opportunity cost of staying in your current role, the mental and time overhead of another loop, the risk that the next loop also results in an L5 offer or no offer.</p><p>The benefit: if you genuinely need 6&#8211;12 months of more senior scope to credibly target L6, you should take the time. The interview will show it.</p><h3><strong>The practical answer</strong></h3><p><strong>Take the L5 offer if:</strong></p><ul><li><p>The company, team, and product are where you want to be</p></li><li><p>The gap to L6 at that company is primarily experience, not skills</p></li><li><p>Internal promotion timelines are reasonable (most major tech companies: 12&#8211;24 months from strong L5 to L6)</p></li></ul><p><strong>Hold out (or negotiate) for L6 if:</strong></p><ul><li><p>You have concrete feedback that the interviewers were split between L5 and L6</p></li><li><p>You have a competing offer at or near L6 to use as leverage</p></li><li><p>The company&#8217;s internal promotion path to L6 is politically difficult or slow</p></li></ul><p>The level on the offer letter matters less than your trajectory after joining. An L5 who performs at L6 in a company with a healthy promotion culture will get to L6. An L6 hired into a frozen headcount situation with no visibility into new scope will not.</p><p>Optimize for the trajectory, not the title on the first day.</p><p><strong>CTA:</strong> The cohort curriculum equips you to demonstrate genuine Staff-level signals before you ever enter a leveling debrief &#8212; training you to project cross-team architectural scope, communicate business-level trade-offs with operational maturity, and navigate L5 vs. L6 career decisions for long-term trajectory rather than just a day-one title.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>Take your understanding further</strong> with premium lessons covering advanced strategies, debugging techniques, and best practices.</p><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[CDNs: What the Edge Keeps, What It Throws Away, and How the Origin Stays Quiet]]></title><description><![CDATA[Cache keys, TTLs, stale-while-revalidate and tiered caching, and the one header that decides most of it]]></description><link>https://systemdr.systemdrd.com/p/cdns-what-the-edge-keeps-what-it</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/cdns-what-the-edge-keeps-what-it</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Thu, 19 Nov 2026 03:30:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!c60P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The problem in one picture</h2><p>A cricket highlights page goes viral at 10 PM. Two million people in India open it in ten minutes. Your origin server sits in one region and can comfortably serve a few thousand requests a second. Without a CDN, it falls over. With a CDN set up badly, it still falls over, because every edge location asks the origin for the same file at the same moment.</p><p>A CDN is a cache that lives in hundreds of cities. It only helps if it answers three questions well: what counts as "the same" request, how long a copy stays good, and who is allowed to bother the origin when a copy runs out.</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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c60P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c60P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!c60P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!c60P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!c60P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c60P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117545,&quot;alt&quot;:&quot;A request walks down the tiers. Each hit stops it early; only the upper tier ever reaches the origin.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A request walks down the tiers. Each hit stops it early; only the upper tier ever reaches the origin." title="A request walks down the tiers. Each hit stops it early; only the upper tier ever reaches the origin." srcset="https://substackcdn.com/image/fetch/$s_!c60P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!c60P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!c60P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!c60P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83da98d1-d490-4947-82bc-25e336e4619b_1800x780.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">A request walks down the tiers. Each hit stops it early; only the upper tier ever reaches the origin.</figcaption></figure></div><h2>Question 1: what counts as the same request?</h2><p>The CDN stores responses under a <strong>cache key</strong>. Two requests with the same key get the same stored copy. Cloudflare's default key is the full URL, including the query string (<a href="https://developers.cloudflare.com/cache/how-to/cache-keys/">Cloudflare docs</a>).</p><p>That default bites people. <code>/logo.png?utm_source=newsletter</code> and <code>/logo.png?utm_source=twitter</code> are two different keys, so the same logo is fetched from your origin twice and stored twice. Multiply by every campaign tag and your hit rate quietly drops.</p><p>The fix is to decide what really changes the response. Tracking parameters don't, so drop them from the key. Language or device type might, so add those on purpose instead of letting every header vary the key.</p><h2>Question 2: how long is a copy good?</h2><p>The origin decides this with the <code>Cache-Control</code> header. <code>max-age=600</code> means "fresh for 600 seconds". While fresh, the edge serves the copy without asking anyone.</p><p>The interesting part is what happens at second 601. A plain cache treats the copy as stale and makes the next viewer wait while it refetches. Two extensions from <a href="https://www.rfc-editor.org/rfc/rfc5861">RFC 5861</a> change that:</p><ul><li><p><strong>stale-while-revalidate=30</strong>: for 30 seconds after expiry, keep serving the stale copy instantly and refetch in the background.</p></li><li><p><strong>stale-if-error=86400</strong>: if the origin returns a 500, 502, 503 or 504, keep serving the stale copy instead of the error.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v41Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v41Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!v41Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cda22532-c9e0-4b42-8220-714f26c56746_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117243,&quot;alt&quot;:&quot;With stale-while-revalidate, nobody waits for the refetch. After the window closes, the next viewer does.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="With stale-while-revalidate, nobody waits for the refetch. After the window closes, the next viewer does." title="With stale-while-revalidate, nobody waits for the refetch. After the window closes, the next viewer does." srcset="https://substackcdn.com/image/fetch/$s_!v41Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!v41Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcda22532-c9e0-4b42-8220-714f26c56746_1800x780.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">With stale-while-revalidate, nobody waits for the refetch. After the window closes, the next viewer does.</figcaption></figure></div><p>The first one hides refetch latency. The second one turns an origin outage into "slightly old content" instead of an error page, which is often the most valuable line in your whole config.</p><h2>Question 3: who gets to bother the origin?</h2><p>Now the viral page again. The copy expires at the same time in 300 edge locations. Each one misses and each one calls the origin. That's a stampede, and it's caused by the CDN's own size.</p><p><strong>Tiered caching</strong> fixes it by putting the edges in a hierarchy. Cloudflare splits its data centers into lower tiers and upper tiers: a lower tier that misses must ask an upper tier, and "only the upper-tier can ask the origin for content" (<a href="https://developers.cloudflare.com/cache/how-to/tiered-cache/">Cloudflare Tiered Cache</a>). Three hundred misses become a handful of origin requests.</p><p>This is the same idea as the lease from the Cache Writes post on Facebook's memcache: when many readers miss at once, let one of them fetch and make the rest reuse its answer.</p><h2>What changes when content changes</h2><p>TTL is the plan; purging is the escape hatch. Two common approaches:</p><ul><li><p><strong>Versioned URLs.</strong> Put a content hash in the file name, like <code>app.3f9a1c.js</code>, and cache it for a year. A new build means a new URL, so nothing needs purging. This is the standard for JS, CSS and images.</p></li><li><p><strong>Purge on change.</strong> For URLs that can't change, like <code>/product/123</code>, keep the TTL short or call the CDN's purge API when the data changes.</p></li></ul><p>Mixing them up is the classic bug: a long TTL on <code>/index.html</code> that points at old versioned files, so users get yesterday's app for a day.</p><h2>How to choose in an interview</h2><p>When a design has static or read-heavy content, say these four things out loud:</p><ol><li><p><strong>What is the cache key?</strong> Strip what doesn't change the response.</p></li><li><p><strong>What is the TTL, and is the content versioned?</strong> Long for versioned assets, short for anything mutable.</p></li><li><p><strong>What happens when the origin is slow or down?</strong> Name stale-while-revalidate and stale-if-error.</p></li><li><p><strong>What stops a stampede on the origin?</strong> Name tiered caching, or request collapsing at the edge.</p></li></ol><h2>Success criteria: check yourself</h2><p>Pick a setup for each, then compare with the answers below:</p><ol><li><p>A product image at <code>/img/123.jpg</code> that is replaced when the seller uploads a new photo.</p></li><li><p>The live score widget on that cricket page, updated every few seconds.</p></li><li><p>A news site that must stay up even when its CMS is down.</p></li></ol><p>You've got it if you chose: (1) a versioned URL like <code>/img/123-v7.jpg</code> with a long TTL, because then a new photo is just a new key; (2) a short max-age of a second or two with stale-while-revalidate, so the edge absorbs the read load and nobody waits on refetches; (3) stale-if-error with a long window, so the last good page keeps serving during the outage.</p><h2>Interview angle</h2><p>Saying "put a CDN in front" is an L4 answer. Naming the cache key, the TTL and how changes reach users is L5. Naming the origin-protection story (tiering, stale-if-error) and what you'd watch, such as edge hit ratio, origin request rate and the share of responses served stale, is L6.</p><h2>Next up</h2><p>Next Thursday: <strong>Idempotency keys</strong>, and how Stripe makes it safe to retry a payment when the network drops halfway through.</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 Recommendation Engine — Walkthrough]]></title><description><![CDATA[Archetype: Search & Ranking &#183; Asked at: Netflix, Spotify, Amazon]]></description><link>https://systemdr.systemdrd.com/p/design-a-recommendation-engine-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-recommendation-engine-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 17 Nov 2026 03:30:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-2Rs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><p>Two distinct recommendation problems that look similar but require different architectures:</p><p>1. <strong>Collaborative filtering </strong>(&#8221;users like you also liked X&#8221;) &#8212; requires knowing the preference matrix across all users</p><p>2. <strong>Content-based filtering </strong>(&#8221;because you liked X, you might like Y&#8221;) &#8212; requires embedding items in a vector space</p><p>Production systems use both, ensembled.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-2Rs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-2Rs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 424w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 848w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-2Rs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png" width="612" height="326.59615384615387" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.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;:612,&quot;bytes&quot;:470165,&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/224583698?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.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_!-2Rs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 424w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 848w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!-2Rs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb50b76-3ccf-437b-9c99-8c4d3b515b05_4500x2400.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h2>Step 1 &#8212; Collaborative Filtering at Scale</h2><p><strong>The preference matrix: </strong>Users &#215; Items, with values = interaction strength (play count, rating, purchase). At Netflix: 270M users &#215; 10K titles = 2.7T cells (sparse &#8212; most users have seen &lt; 0.1% of catalog).</p><p><strong>Matrix factorization (ALS): </strong>Decompose the user-item matrix into two lower-rank matrices: User vectors (U) and Item vectors (I), where U &#215; I&#7488; &#8776; the original matrix. Each user gets a 128-dimensional vector; each item gets a 128-dimensional vector. Recommendation = find items whose vector is closest to the user&#8217;s vector.</p><p><strong>Approximate nearest neighbor (ANN): </strong>Given a user vector, find the K nearest item vectors. FAISS (Facebook AI Similarity Search) builds an index of item vectors and returns top-K in O(log N) time.</p><p><strong>Training: </strong>ALS runs offline (weekly or daily) on the full interaction matrix. Too expensive for real-time. Outputs: user vectors (one per user) and item vectors (one per item) &#8212; stored in the feature store.</p><p><strong>Inference (online): </strong>ANN lookup on the precomputed item index, given the user&#8217;s stored vector. Returns top-K candidates in &lt; 50ms.</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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/system-design-roadmap-landing-page/">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>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-recommendation-engine-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Why Your Deep Dives Aren't Landing]]></title><description><![CDATA[The deep dive tests whether you can find the hard part. Here's the four-part shape that lands]]></description><link>https://systemdr.systemdrd.com/p/why-your-deep-dives-arent-landing</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/why-your-deep-dives-arent-landing</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Mon, 16 Nov 2026 03:30:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!pnXO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You can usually tell in the first 90 seconds of a deep dive whether it will land. The test is simple: is the candidate going deeper on the right component?</p><h2>The pattern in deep dives that miss</h2><p>When the deep dive starts, most candidates go deeper on the component they know best. Not the component that's hardest to get right, and not the one the interviewer most wants to probe. The comfortable one.</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>That's the wrong choice. The deep dive exists to show whether you can reason through the genuinely hard problem at the centre of the question.</p><ul><li><p><strong>WhatsApp:</strong> the hard part is delivery under failure, not setting up the WebSocket connection.</p></li><li><p><strong>Netflix:</strong> the hard part is getting popular content to the edge before it's requested, not the storage bucket layout.</p></li><li><p><strong>Stripe Payments:</strong> the hard part is idempotency when the network drops mid-request, not the REST API design.</p></li><li><p><strong>Uber Dispatch:</strong> the hard part is a geo index that keeps up with every driver's location update, not the booking state machine.</p></li></ul><p>If you catch yourself explaining REST conventions during the deep dive, you've drifted to comfortable ground. Move.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pnXO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pnXO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 424w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 848w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 1272w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pnXO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png" width="668" height="356.4807692307692" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.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;:668,&quot;bytes&quot;:529313,&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/222731538?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.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_!pnXO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 424w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 848w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 1272w, https://substackcdn.com/image/fetch/$s_!pnXO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F861b37ba-e499-4e5f-afdb-fbb90552eb2a_3600x1920.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h2>Find the hard part before you start</h2><p>The hard part is usually the one with no obvious standard answer. REST API design has one: follow the conventions. "What happens when 50 million people start the same episode at 9 pm?" doesn't. It needs you to reason about caching at the edge, warming those caches, and what happens on a miss.</p><p>Before the deep dive, take 30 seconds and name the three places in your design where the answer isn't obvious. Then pick the hardest.</p><p>Watch for one phrase in your own answer: "that's handled by the infrastructure". It's almost always the component the interviewer wants to open up. "The CDN handles it" isn't a design. Which CDN, caching what, warmed how, falling back to what?</p><h2>How to recover mid-answer</h2><p>If you realise halfway through that you're deep in the wrong component, stop and say so:</p><p>"I've spent time on the API, but the harder problem is delivery when the recipient is offline. Let me go there."</p><p>That isn't a sign of confusion. It's the same scoping skill interviewers look for at the start, used again under pressure.</p><h2>What a deep dive that lands looks like</h2><p>It has four parts, in this order:</p><ol><li><p><strong>The problem, stated precisely.</strong> Not "what if things fail", but "a worker crashes after taking a task and before acknowledging it. The visibility timeout brings the task back, so how long should that timeout be?"</p></li><li><p><strong>Two or three real options and their costs.</strong> Not "add retries", but "fixed-interval retries line every client up to hit the server at the same moment when it recovers; exponential backoff with jitter spreads them out."</p></li><li><p><strong>A recommendation with a reason.</strong> "Exponential backoff from 10 seconds, doubling to a one-hour cap, with about 20% jitter. The cap stops a broken task from retrying forever."</p></li><li><p><strong>A signal you'd watch.</strong> "Alert on dead-letter queue depth growing. That's the first sign the retry policy isn't working."</p></li></ol><p>Problem, options, recommendation, signal. Practise those four on every question until it's automatic.</p><p>The deep dive isn't hard because the content is hard. It's hard because it means going to the part you're least sure of and reasoning through it out loud anyway.</p><h2>Next up</h2><p>This week's paid walkthrough, Design a Notification System, is a full deep dive on the hard part of a common question: fan-out to push, email and SMS without spamming anyone twice. Next Sunday: the mock interview mistakes that are easiest to see from the outside.</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[Caching: Write-Through, Write-Back, Write-Around]]></title><description><![CDATA[Most system design candidates know what a cache is.]]></description><link>https://systemdr.systemdrd.com/p/caching-write-through-write-back</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/caching-write-through-write-back</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 15 Nov 2026 03:30:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gReO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most system design candidates know what a cache is. Fewer know how data gets into it. Even fewer can explain the consistency implications of each approach.</p><p>Here are the three cache write strategies, when each breaks, and how to choose between them in an interview.</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 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><h3><strong>Write-through</strong></h3><p>When a write happens: update the cache and the database simultaneously. Both are updated before the write is acknowledged to the caller.</p><p>Consistency model: strong. Any subsequent read from the cache will see the latest write. The cache is always in sync with the database.</p><p>The cost: every write takes longer. The caller waits for both the cache and the database to confirm. For read-heavy systems where cache consistency is critical and writes are infrequent, this is the right trade-off.</p><p>Where it breaks: under heavy write load. If you&#8217;re processing 50,000 writes per second, waiting for both cache and database on every write doubles your write latency. You also write to the cache even for data that will never be read &#8212; if you write a user&#8217;s address and nobody reads that user&#8217;s profile for a month, the cache entry was wasted.</p><p>Use write-through when: the data is read frequently after each write, and consistency between cache and database is required at all times. User profile reads immediately after an update. Configuration changes that must be reflected immediately.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gReO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gReO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 424w, https://substackcdn.com/image/fetch/$s_!gReO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 848w, https://substackcdn.com/image/fetch/$s_!gReO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!gReO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!gReO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png" width="1456" height="809" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:809,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:602654,&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/224556823?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.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_!gReO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 424w, https://substackcdn.com/image/fetch/$s_!gReO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 848w, https://substackcdn.com/image/fetch/$s_!gReO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!gReO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e693f9-53c4-4f1a-b70c-8c59eac562ff_3600x2000.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h3><strong>Write-back (write-behind)</strong></h3><p>When a write happens: update the cache immediately and acknowledge to the caller. Write to the database asynchronously in the background.</p><p>Consistency model: eventual between cache and database. The cache has the latest data. The database lags by whatever the flush interval is.</p><p>The benefit: write latency is extremely low &#8212; the caller doesn&#8217;t wait for the database.</p><p>Where it breaks: if the cache node fails before the flush, the writes are lost. This is a real data loss scenario. Write-back is not appropriate for financial data, user records, or anything where losing a write is unacceptable.</p><p>Use write-back when: write latency is critical and some data loss under failure is acceptable. Analytics counters. Non-critical telemetry. Systems where re-deriving the data from another source is possible.</p><h3><strong>Write-around</strong></h3><p>When a write happens: write directly to the database, bypassing the cache entirely. The cache is only populated on read (when a cache miss occurs and the data is fetched from the database).</p><p>Consistency model: strong. The database is always the source of truth. The cache holds whatever was last read.</p><p>Where it breaks: high cache miss rate for new or recently-written data. If you write data and immediately read it, the first read is always a cache miss. Under write-heavy workloads where most new data is read immediately, write-around causes a flood of cache misses.</p><p>Use write-around when: data is written once and rarely read, or the write pattern and read pattern are decoupled. Large file writes (S3 is the database, CDN is the cache &#8212; write to S3, CDN populates on first request). Logging. Batch import jobs where the imported data isn&#8217;t immediately queried.</p><h3><strong>How to choose in an interview</strong></h3><p>The decision follows from two questions:</p><p>First: how often is data read immediately after it&#8217;s written? If frequently &#8594; write-through or write-back (cache gets populated on write). If rarely &#8594; write-around (avoid polluting cache with data nobody reads).</p><p>Second: can you tolerate data loss on cache failure? If no &#8594; write-through (database always has the data). If yes &#8594; write-back (lowest write latency).</p><p>The standard production pattern for a read-heavy web application: write-through for user data and configuration, write-around for analytics and logging, write-back only for session counters and similar low-stakes high-frequency writes.</p><p>Naming the strategy is the L4 answer. Naming the strategy plus the failure mode plus the condition under which you&#8217;d switch is the L5 answer. Adding the monitoring signal that tells you the strategy is no longer appropriate (cache hit rate dropping, write latency spiking) is the L6 answer.</p><p><strong>CTA:</strong> The cohort curriculum cuts through high-level cache definitions &#8212; teaching you how to rigorously evaluate write-through, write-back, and write-around strategies against latency, consistency, and failure modes, and how to scale your architectural reasoning from L4 implementation choices to L6 operational monitoring signals.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>Want the full picture?</strong></p><p>The premium lessons include advanced insights, practical exercises, and comprehensive walkthroughs.</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 Notification System (Push, Email, SMS) — Walkthrough]]></title><description><![CDATA[Archetype: Product & Messaging &#183; Build-along: dedupe, preferences, quiet hours, digests and per-channel lanes, with 8 checks you can run]]></description><link>https://systemdr.systemdrd.com/p/design-a-notification-system-push</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-notification-system-push</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Fri, 13 Nov 2026 20:46:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!I8Zt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Where we are</h2><p>Last week's Webhook Delivery System sent events to servers you don't control. Today the other end is a person. A person can't return a 500, but they can switch off your notifications, mark your email as spam, or delete your app. Those are worse than any error code.</p><p>So a notification system has two jobs. Deliver the messages that matter, reliably, on the right channel. And refuse to send the ones that don't. By the end you'll have a working system that passes eight checks, from "the same event three times is one notification" to "an email outage can't slow down a single push".</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I8Zt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I8Zt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 424w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 848w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 1272w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I8Zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png" width="588" height="274.4" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:1800,&quot;resizeWidth&quot;:588,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;One event, one set of rules, three lanes that never wait for each other.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="One event, one set of rules, three lanes that never wait for each other." title="One event, one set of rules, three lanes that never wait for each other." srcset="https://substackcdn.com/image/fetch/$s_!I8Zt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 424w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 848w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 1272w, https://substackcdn.com/image/fetch/$s_!I8Zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce80aa21-3200-412f-8912-dbd01b3beb97_1800x840.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">One event, one set of rules, three lanes that never wait for each other.</figcaption></figure></div><h2>The problem in one picture</h2><p>A food app sends three kinds of messages. "Your code is 482913" must arrive in seconds or the login fails. "Your order is out for delivery" is useful for about half an hour. "Priya liked your review" is pleasant once and irritating the twentieth time.</p><p>Most designs treat all three the same: put a message on a queue, a worker sends it. That works on the whiteboard and fails in three ways in production.</p><ul><li><p><strong>Too much.</strong> LinkedIn cut its email volume in half after members complained, and complaints fell by more than 65% (<a href="https://blog.linkedin.com/2015/11/10/sending-less-email-is-just-the-beginning">LinkedIn blog, 2015</a>). Sending less was the fix, not sending faster.</p></li><li><p><strong>Too late.</strong> Netflix's RENO notification service drops events that are older than a set age, because many updates lose their value if they arrive late (<a href="https://www.infoq.com/news/2022/03/netflix-reno">InfoQ on Netflix RENO</a>).</p></li><li><p><strong>Stuck behind someone else.</strong> RENO also splits its queues and workers by priority, so a backlog of low-value events can't delay urgent ones.</p></li></ul><p>The interviewer wants to hear you design for all three. Throughput is the easy part.</p><h2>Core idea: four questions, then a lane</h2><p>Every notification answers four questions, in this order, before it's allowed near a provider.</p><ol><li><p><strong>Have we seen it already?</strong> Producers retry. The order service may call you three times for one shipment. A dedupe key turns three calls into one notification.</p></li><li><p><strong>Is this channel allowed?</strong> The user may have turned off email for likes but kept push. Preferences are checked per category and per channel, never as one on/off switch.</p></li><li><p><strong>Is it the middle of their night?</strong> Quiet hours are computed in the user's own time zone. Non-urgent messages wait until morning. A login alert does not.</p></li><li><p><strong>Have we sent too many?</strong> Past a cap, new messages of the same kind fold into one digest instead of each buzzing the phone.</p></li></ol><p>Only then does a message enter its channel's lane: push, email or SMS. Each lane has its own workers, retry schedule and rate limit. One slow channel can't block another.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0cV5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0cV5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 424w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 848w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 1272w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!0cV5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png" width="1800" height="930" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:930,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Four questions in order. A \&quot;no\&quot; drops, logs, delays or folds the message. It never just disappears.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Four questions in order. A &quot;no&quot; drops, logs, delays or folds the message. It never just disappears." title="Four questions in order. A &quot;no&quot; drops, logs, delays or folds the message. It never just disappears." srcset="https://substackcdn.com/image/fetch/$s_!0cV5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 424w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 848w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 1272w, https://substackcdn.com/image/fetch/$s_!0cV5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c89b25d-fe6a-4fd3-a0f8-55a245284b42_1800x930.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Four questions in order. A "no" drops, logs, delays or folds the message. It never just disappears.</figcaption></figure></div><p>Two words you'll use all lesson:</p><ul><li><p><strong>Critical</strong> messages (OTPs, security alerts) skip quiet hours and caps. Keep this list short, or everything becomes critical.</p></li><li><p><strong>Every "no" is written down.</strong> A suppressed or failed send is a row with a reason. When a user asks "why didn't I get my code?", support can answer from a query, not a guess.</p></li></ul>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-notification-system-push">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[When to Take the L5 Offer vs Wait for L6]]></title><description><![CDATA[Three questions decide it, and only one of them is about the interview]]></description><link>https://systemdr.systemdrd.com/p/when-to-take-the-l5-offer-vs-wait</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/when-to-take-the-l5-offer-vs-wait</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Wed, 11 Nov 2026 05:30:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!l_WD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The message usually reads: "I have an L5 offer, but I think I could get L6. Should I push for the level or take it?"</p><p>Most advice answers with a number. The better answer starts with three questions, and only one of them is about the interview.</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><h2>The real question isn't the level</h2><p>"Take L5 or hold out for L6?" is really three questions:</p><ol><li><p>Are you already doing L6 work in your current role?</p></li><li><p>Did the interview give real signal that you're close to L6?</p></li><li><p>What does waiting cost you?</p></li></ol><p>Most people only think about the second one. The other two decide the outcome just as often.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l_WD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l_WD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 424w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 848w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 1272w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l_WD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png" width="596" height="370.8626373626374" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:906,&quot;width&quot;:1456,&quot;resizeWidth&quot;:596,&quot;bytes&quot;:682840,&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/222731537?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.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_!l_WD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 424w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 848w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 1272w, https://substackcdn.com/image/fetch/$s_!l_WD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71f3227f-443c-4359-8b86-13aede945e5c_3600x2240.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h2>1. Are you already doing L6 work?</h2><p>At most large tech companies, L6 (Staff at Google, E6 at Meta) means you set technical direction for a team or product area, your work reaches across teams, and your decisions carry real business weight.</p><p>If you're a senior engineer whose decisions mostly shape your own work, you're probably not there yet. Being capable of L6 and having a track record at L6 are different things. An interview can test the first; only time in the role builds the second.</p><p>An L5 who does L6 work after joining is on the normal promotion path. Over a year or two, the pay gap between "hired at L6" and "promoted to L6" is often smaller than it looks on the offer letter.</p><h2>2. Did the interview give real L6 signal?</h2><p>"The recruiter said I was close to L6" is not the same thing.</p><p>Real signal sounds like specific debrief feedback that names L6 as a possible outcome and points to gaps you can close with scope, not skills you lack. For example: "Strong L5. Clear signals on operational maturity and cross-team influence. Could see L6 with more scope."</p><p>"We'd love to revisit your level later" and "you're one of our strongest L5 candidates" are friendly. They aren't signal.</p><p>If the feedback is vague and you push anyway, the likely results are: the level stays the same and you've spent goodwill, or you get the L6 title with an equity package calibrated low. The money moves less than the title.</p><h2>3. What does waiting cost?</h2><p>Waiting means turning this offer down, preparing more, and running another loop somewhere else in 6 to 12 months.</p><p>The costs are real: another loop's worth of evenings, the chance it ends at L5 again, and a year of the role you're in now. Waiting is worth it only if you genuinely need that year of bigger scope to make an L6 case. The next interview will show whether you did.</p><h2>The practical answer</h2><p>Take the L5 offer if:</p><ul><li><p>The company, team and product are where you want to be.</p></li><li><p>Your gap to L6 is experience, not skills.</p></li><li><p>People there get promoted from L5 to L6 on a reasonable timeline. Ask your future manager how many of their L5s made L6 in the last two years.</p></li></ul><p>Push for L6, or keep looking, if:</p><ul><li><p>You have written feedback that the panel was split between L5 and L6.</p></li><li><p>You have a competing offer at or near L6.</p></li><li><p>Promotion to L6 at this company is known to be slow or political.</p></li></ul><p>The level on day one matters less than the slope after it. An L5 doing L6 work on a team with room to grow gets there. An L6 hired into a team with no new scope often stalls.</p><p>Pick the slope, not the title.</p><h2>Next up</h2><p>This week's paid walkthrough shows what L6 scope looks like in a real design: Design a Webhook Delivery System, where the Staff answer is about second-order effects, not more boxes. Next Sunday: why your deep dives aren't landing.</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 CI/CD Pipeline — Walkthrough Archetype: Infrastructure & Platform]]></title><description><![CDATA[Asked at: GitHub, GitLab, Shopify, Netflix]]></description><link>https://systemdr.systemdrd.com/p/design-a-cicd-pipeline-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-cicd-pipeline-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 10 Nov 2026 03:30:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!LBQL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7201d709-7014-4bcf-8b99-d57ad79a3e03_4500x2900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>A CI/CD system is a distributed task execution engine with dependencies (steps must run in order), resource management (build agents have finite capacity), and artifact management (build outputs must be stored and retrieved). The interesting distributed systems problem is the task scheduler under resource constraints.</p></blockquote><h2>Step 1 &#8212; Clarify</h2><p>- Trigger: push to any branch, PR creation, or manual?</p><p>- Steps: lint &#8594; test &#8594; build &#8594; deploy (DAG with dependencies)</p><p>- Build agents: fixed pool or autoscaled? (Autoscaled is production)</p><p>- Artifact storage: where do build outputs go?</p><p>- Maximum pipeline duration SLO: 10 minutes (GitHub Actions target)</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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/system-design-roadmap-landing-page/">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>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-cicd-pipeline-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Estimation Formula]]></title><description><![CDATA[The three-sentence pattern]]></description><link>https://systemdr.systemdrd.com/p/the-estimation-formula</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-estimation-formula</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 08 Nov 2026 03:30:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PVBF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3><strong>The three-sentence pattern</strong></h3><p><strong>1. The choice: </strong>What you decided.</p><p><strong>2. The reason: </strong>Why you decided it (linked to a specific constraint or number from your estimation).</p><p><strong>3. The revisit condition: </strong>Under what specific change would you make a different decision?</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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PVBF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PVBF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 424w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 848w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 1272w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PVBF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png" width="1456" height="938" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:938,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:649622,&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/222464624?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.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_!PVBF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 424w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 848w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 1272w, https://substackcdn.com/image/fetch/$s_!PVBF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e1bc912-b755-4f3a-bbf2-1f90358ef0f0_3600x2320.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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>Example (weak): </strong>&#8216;I&#8217;d use Redis for caching.&#8217;</p><p><strong>Example (strong): </strong>&#8216;I&#8217;d use Redis for the timeline cache with LRU eviction and a 24-hour TTL, because the hot read pattern is point lookups by user_id and Redis&#8217;s sub-millisecond gets absorb the read load that would otherwise hit Postgres on every feed request. If the working set grows beyond 20% of total users being active simultaneously, Redis memory becomes expensive &#8212; at that point I&#8217;d evaluate a tiered cache or move to Memcached.</p><p><strong>CTA</strong>: The cohort curriculum trains you to replace vague design choices with the three-sentence framework &#8212; teaching you to state exact technical decisions, ground your choices in concrete system constraints, and define precise monitoring triggers to revisit trade-offs under scale.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>Interested in mastering this topic?</strong> </p><p>Unlock premium content with deeper explanations and real implementation 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[Cache Writes: Write-Through, Write-Back, Write-Around, and What Facebook Actually Does]]></title><description><![CDATA[The three textbook strategies, where each one breaks, and the delete-plus-lease pattern behind Facebook's memcache]]></description><link>https://systemdr.systemdrd.com/p/cache-writes-write-through-write</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/cache-writes-write-through-write</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Thu, 05 Nov 2026 03:30:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nn11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The problem in one picture</h2><p>A seller changes a price from &#8377;999 to &#8377;799. The database has the new price. The cache still says &#8377;999, and every shopper who hits the cache sees the old one.</p><p>Every cache has to answer one question: when data changes, what happens to the copy in the cache? There are three textbook answers, and one that the biggest cache deployments actually use.</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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nn11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nn11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!nn11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!nn11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!nn11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nn11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three ways a write can treat the cache. Solid lines wait; dashed lines happen later.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three ways a write can treat the cache. Solid lines wait; dashed lines happen later." title="Three ways a write can treat the cache. Solid lines wait; dashed lines happen later." srcset="https://substackcdn.com/image/fetch/$s_!nn11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!nn11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!nn11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!nn11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F287fab85-1f65-4876-8710-661e96d24ee5_1800x780.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Three ways a write can treat the cache. Solid lines wait; dashed lines happen later.</figcaption></figure></div><h2>Three textbook strategies</h2><p><strong>Write-through.</strong> Write to the cache and the database together, and only then tell the caller "done". Reads right after a write always see the new value. The price: every write waits for two systems, and you fill the cache with data nobody may read.</p><p>Use it when data is read soon after it's written and must never look stale, such as a user's settings page right after they save.</p><p><strong>Write-back (write-behind).</strong> Write to the cache, answer the caller at once, and flush to the database later. Writes are as fast as the cache. The price: if the cache node dies before the flush, those writes are gone.</p><p>Use it only where losing a few writes is acceptable or rebuildable, like view counters or telemetry. Your laptop already does this: the operating system keeps changed file pages in memory and writes them to disk later, which is why databases call <code>fsync</code> when they can't afford to lose data.</p><p><strong>Write-around.</strong> Write only to the database and let the cache fill itself on the next read miss. The cache never holds data nobody asked for. The price: the first read after every write is a miss.</p><p>Use it when writes are rarely read straight away, like uploads served through a CDN: the file goes to object storage, and the CDN pulls it on the first request.</p><h2>What big-tech teams actually do</h2><p>Facebook's memcache deployment, described in the NSDI 2013 paper <a href="https://engineering.fb.com/2013/04/15/core-infra/scaling-memcache-at-facebook/">Scaling Memcache at Facebook</a>, uses none of the three as written. It runs a <strong>look-aside</strong> cache: on a read miss the app fetches from the database and fills the cache; on a write the app updates the database and then <strong>deletes</strong> the key instead of writing the new value.</p><p>Why delete instead of update? The cached value is often built by application code from several queries, so the write path doesn't know what the cached value should be. Deleting is simple and safe to repeat. The next reader rebuilds the value (<a href="https://people.csail.mit.edu/alinush/6.824-spring-2015/l16-memcached.html">MIT 6.824 notes on the paper</a>).</p><p>Deleting creates two new problems, and the paper solves both with <strong>leases</strong>:</p><ul><li><p><strong>Stale sets.</strong> A reader misses and fetches the old value. Before it writes that value to the cache, a writer updates the database and deletes the key. The reader then puts the stale value back, and it stays there until the next write. With leases, a miss hands the reader a lease, a delete cancels it, and the cache refuses the late, stale set.</p></li><li><p><strong>Thundering herds.</strong> A hot key is deleted and thousands of readers miss at once, all hitting the database. With leases, only the first reader gets permission to fetch; the rest wait briefly and retry against the cache.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GjC7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GjC7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!GjC7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png" width="1800" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Delete on write, plus a lease: the stale set from the slow reader is refused.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Delete on write, plus a lease: the stale set from the slow reader is refused." title="Delete on write, plus a lease: the stale set from the slow reader is refused." srcset="https://substackcdn.com/image/fetch/$s_!GjC7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 424w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 848w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 1272w, https://substackcdn.com/image/fetch/$s_!GjC7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f76024-2b9c-4725-9a71-78b10f4c9603_1800x780.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Delete on write, plus a lease: the stale set from the slow reader is refused.</figcaption></figure></div><h2>How to choose in an interview</h2><p>Ask two questions out loud:</p><ol><li><p>Is data read right after it's written? If yes, populate on write (write-through) or delete-and-refill (look-aside). If no, write-around.</p></li><li><p>Can you lose a write if a cache node dies? If no, the database must be written before you answer. If yes, write-back is on the table.</p></li></ol><p>Then name the failure mode of what you picked. That's the step most candidates skip.</p><h2>Success criteria: check yourself</h2><p>Pick a strategy for each, then compare with the answers below:</p><ol><li><p>A product catalogue where prices change a few times a day and are read millions of times.</p></li><li><p>A "views" counter on every video.</p></li><li><p>Profile photos uploaded once and shown later through a CDN.</p></li></ol><p>You've got it if you chose: (1) look-aside with delete on write, because reads dominate and stale prices are costly; (2) write-back, because a few lost increments don't matter; (3) write-around, because the CDN fills on first view. Bonus if you named the failure for each: stale sets, lost counts on node failure, and a slow first view.</p><h2>Interview angle</h2><p>Naming a strategy is an L4 answer. Naming it with its failure mode and when you'd switch is L5. Adding how you'd detect it going wrong is L6: watch the cache hit rate after deploys, write latency at peak, and the database read rate when a hot key is deleted.</p><h2>Next up</h2><p>Next Thursday: CDNs: write-around caching at the edge, and how they decide what to keep. This week's paid walkthrough, Design a Webhook Delivery System, puts the same "deliver, retry, never lose it" thinking to work across thousands of servers you don't control.</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 Webhook Delivery System (Stripe/Shopify/GitHub) — Walkthrough]]></title><description><![CDATA[Archetype: Infrastructure & Platform &#183; Build-along: retries, per-endpoint isolation, signatures and SSRF, with 8 checks you can run]]></description><link>https://systemdr.systemdrd.com/p/design-a-webhook-delivery-system</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-webhook-delivery-system</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 03 Nov 2026 03:30:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nGe_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Where we are</h2><p>In the Distributed Task Queue walkthrough we built workers that pull jobs from a queue we own. Today the other end of the wire belongs to someone else. A webhook system sends your events to thousands of servers you don't control, and some of them will be slow, broken or gone.</p><p>By the end of this lesson you'll have a working sender and receiver that pass eight checks: nothing lost, nothing processed twice, one bad customer can't slow the rest, and forged or replayed requests bounce.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nGe_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nGe_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 424w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 848w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 1272w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nGe_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png" width="1800" height="840" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Today's piece: the dispatcher between your app and everyone else's servers.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Today's piece: the dispatcher between your app and everyone else's servers." title="Today's piece: the dispatcher between your app and everyone else's servers." srcset="https://substackcdn.com/image/fetch/$s_!nGe_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 424w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 848w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 1272w, https://substackcdn.com/image/fetch/$s_!nGe_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F207356b9-bb8f-4cd9-9ab0-c1b41da6991f_1800x840.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Today's piece: the dispatcher between your app and everyone else's servers.</figcaption></figure></div><h2>The problem in one picture</h2><p>When a payment succeeds, Stripe POSTs an <code>invoice.paid</code> event to your server. That sounds like one HTTP call. In practice it is a promise: "this message will arrive, even if your server is down for a day."</p><p>Each big platform has written down how far that promise goes:</p><ul><li><p><strong>Stripe</strong> retries for up to three days with exponential backoff in live mode, and says plainly that it doesn't guarantee events arrive in order (<a href="https://docs.stripe.com/webhooks">Stripe docs</a>).</p></li><li><p><strong>Shopify</strong> gives your endpoint five seconds to answer, retries up to eight times over four hours, and removes the subscription if failures continue (<a href="https://shopify.dev/docs/apps/build/webhooks/troubleshooting">Shopify docs</a>).</p></li><li><p><strong>GitHub</strong> waits 10 seconds and does not retry automatically at all. You redeliver failures yourself (<a href="https://docs.github.com/webhooks/using-webhooks/handling-failed-webhook-deliveries">GitHub docs</a>).</p></li></ul><p>Three companies, three very different answers. The interviewer wants to hear you choose one on purpose.</p><h2>Core idea: four promises</h2><p>A webhook system makes four promises. Every design decision traces back to one of them.</p><ol><li><p><strong>Durable.</strong> If the event happened, it will be sent. No event is lost because a process crashed between "save the order" and "send the webhook."</p></li><li><p><strong>Isolated.</strong> One customer's slow server never delays anyone else.</p></li><li><p><strong>Verifiable.</strong> The receiver can prove the request came from you, wasn't changed, and isn't an old one replayed.</p></li><li><p><strong>Recoverable.</strong> When delivery finally gives up, the event is parked, not deleted, and can be replayed later.</p></li></ol><p>Notice what is missing: "exactly once." Over a network you can't promise that. You deliver at least once and give the receiver what it needs to ignore duplicates. Stripe's docs say the same: endpoints "might occasionally receive the same event more than once."</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FNMr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FNMr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 424w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 848w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 1272w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 1456w" sizes="auto, 100vw"><img src="https://substackcdn.com/image/fetch/$s_!FNMr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png" width="1800" height="900" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:900,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Every delivery is a small state machine. Dead is a parking spot, not a trash can.&quot;,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Every delivery is a small state machine. Dead is a parking spot, not a trash can." title="Every delivery is a small state machine. Dead is a parking spot, not a trash can." srcset="https://substackcdn.com/image/fetch/$s_!FNMr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 424w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 848w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 1272w, https://substackcdn.com/image/fetch/$s_!FNMr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c07a97a-49f3-4322-b1a9-cc0e01e07e2c_1800x900.png 1456w" sizes="auto, 100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><figcaption class="image-caption">Every delivery is a small state machine. Dead is a parking spot, not a trash can.</figcaption></figure></div>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-webhook-delivery-system">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design a Real-time Collaborative Editor (Google Docs) — Walkthrough]]></title><description><![CDATA[Archetype: Real-time Messaging &#183; Asked at: Google, Notion, Figma]]></description><link>https://systemdr.systemdrd.com/p/design-a-real-time-collaborative</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-real-time-collaborative</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 03 Nov 2026 03:30:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0Tp-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F112d93be-06c9-471e-854a-dcf8c7f038da_4000x2750.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>This is the hardest question in the question bank. The problem: two users type simultaneously into the same document. Both changes must be preserved, in a consistent order, on both clients, in real time. This requires <strong>Operational Transformation (OT) </strong>or <strong>CRDTs </strong>&#8212; the most complex distributed consistency problem in a product context.</p></blockquote><h2>Step 1 &#8212; Clarify</h2><p>- How many simultaneous editors? (Google Docs: up to ~100 simultaneous, typical: 2&#8211;10) - Conflict resolution: last-writer-wins (loses data), OT (complex, correct), CRDT (simpler, eventually consistent)</p><p>- Rich text (bold, links, images) or plain text? Rich text requires operation types beyond insert/delete</p><p>- Real-time (&lt; 200ms) or near-real-time (&lt; 1s)?</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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/system-design-roadmap-landing-page/">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><h2>The Core Problem &#8212; Why naive approaches fail</h2><p><strong>Naive approach 1: </strong>Each keystroke triggers a POST to the server; server updates the document; all clients re-fetch. </p><p><strong>Fails because: </strong>At 100 keystrokes/sec &#215; 10 users = 1000 req/sec just for one document. And the user sees their own edits delayed by a round-trip.</p><p><strong>Naive approach 2: </strong>Last-writer-wins &#8212; each client sends the full document state periodically. </p><p><strong>Fails because: </strong>If A types &#8220;Hello&#8221; and B types &#8220;World&#8221; simultaneously, one overwrites the other.</p>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-real-time-collaborative">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Most-Clicked Post in the Archive]]></title><description><![CDATA[Every quarter I look at the analytics across the full archive and find the same surprise: the highest-clicked posts aren&#8217;t the ones I thought were the best.]]></description><link>https://systemdr.systemdrd.com/p/the-most-clicked-post-in-the-archive</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-most-clicked-post-in-the-archive</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 01 Nov 2026 03:30:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GuKy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Every quarter I look at the analytics across the full archive and find the same surprise: the highest-clicked posts aren&#8217;t the ones I thought were the best.</p><p>After running the newsletter for six months, here&#8217;s what the data shows about what actually resonates &#8212; and what it means for how you should be reading.</p></blockquote><h3><strong>The most-opened posts are the career ones</strong></h3><p>Posts about levels (L4 vs L5 vs L6), about preparing in the month before an onsite, about why strong engineers fail &#8212; these consistently outperform the technical concept primers.</p><p>This makes sense in retrospect. Engineers subscribe to this newsletter because they have a goal: pass an interview and get an offer. The career posts speak directly to that goal. The technical posts are instrumental to the goal.</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 implication: if you find yourself skipping the career posts and reading only the technical ones, you&#8217;re probably missing the higher-leverage content.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GuKy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GuKy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 424w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 848w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 1272w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GuKy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png" width="1456" height="938" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:938,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:763907,&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/221592116?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.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_!GuKy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 424w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 848w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 1272w, https://substackcdn.com/image/fetch/$s_!GuKy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7ff2b1-b779-4ce0-920d-6ee09a269813_3600x2320.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h3><strong>The highest-clicked posts are the ones that name something</strong></h3><p>The best-performing posts have one thing in common: they name a specific concept, pattern, or failure mode that the reader has encountered but couldn&#8217;t articulate.</p><p>&#8220;The three-sentence pattern&#8221; (choice, reason, revisit condition) was the most-forwarded piece in the archive&#8217;s first three months. Not because engineers didn&#8217;t know how to explain trade-offs &#8212; they did. But because naming the pattern explicitly gave them a framework they could apply consciously instead of relying on it when it worked and missing it when it didn&#8217;t.</p><h3><strong>The most-replied posts are the community ones</strong></h3><p>Every time I write about offers landed, or about what cohort members got wrong, or about specific company interview patterns &#8212; I get more replies than from any technical post.</p><p>The replies tell me what to write next. Someone will reply &#8220;I&#8217;ve noticed the same thing at Amazon specifically &#8212; can you write more about what their interviewers actually probe?&#8221; and that becomes the seed for a future post.</p><p>If you&#8217;re reading a post and you have a reaction &#8212; agreement, disagreement, a story that contradicts mine &#8212; reply. It improves the newsletter, and if the exchange is interesting and you&#8217;re okay with being anonymized, it often becomes a future post.</p><h3><strong>What this means for subscribers who are actively prepping</strong></h3><p>Read the technical posts for the content. Read the career posts for the strategy. They&#8217;re meant to work together &#8212; the framework tells you how to use the content.</p><p>If you&#8217;re four weeks from an onsite and you&#8217;re using your Sunday reading time to read one more technical concept primer: consider reading the career post instead. You probably have the technical vocabulary you need. What the career posts give you is the system for deploying it under pressure.</p><p>One practical recommendation: if you&#8217;ve been subscribed for more than 8 weeks, go back to the archive and read every career post you&#8217;ve skipped. In sequence, they form something close to a complete interview strategy. Any single post is useful in isolation. Together they&#8217;re a coherent system.</p><p><strong>CTA</strong>: The cohort curriculum bridges the gap between raw technical depth and strategic delivery &#8212; equipping you with explicit frameworks to articulate complex concepts, actionable career strategy to navigate L4&#8211;L6 expectations, and the exact deployment tactics needed to perform under pressure.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>Looking for more practical examples?</strong> </p><p>The premium version includes projects, templates, and real-world scenarios.</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 Tinder Matching — Walkthrough]]></title><description><![CDATA[Archetype: Marketplace & Matching &#183; Asked at: Match Group, Bumble, Hinge]]></description><link>https://systemdr.systemdrd.com/p/design-tinder-matching-walkthrough</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-tinder-matching-walkthrough</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:30:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Q4r7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b62184c-3e36-4bd4-b4ca-87f323d1f073_4750x4500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>Two-sided marketplace matching with asymmetric information (you don&#8217;t know who liked you until you match). The interesting system design problem is the &#8220;like&#8221; storage &#8212; when user A likes user B, how do you efficiently detect that B has also liked A (a mutual match)?</p></blockquote><h2>Step 1 &#8212; Data Model</h2><p>profiles: user_id, age, gender, location (geohash), photos[], bio, preferences{...} likes: liker_id, liked_id, created_at</p><p>UNIQUE INDEX: (liker_id, liked_id)</p><p>matches: match_id, user_id_1, user_id_2, created_at</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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; <strong><a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">Get the 52 FAANG Question Vault</a></strong></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;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://systemdr.systemdrd.com/subscribe"><span>Get Access to Github Repo</span></a></p><h2>Step 2 &#8212; Match detection</h2><div class="callout-block" data-callout="true"><p>When user A likes user B:</p><p>INSERT INTO likes (liker_id, liked_id) VALUES (A, B);</p><p>-- Check if B already liked A</p><p>SELECT 1 FROM likes WHERE liker_id=B AND liked_id=A LIMIT 1;</p><p>-- If found: create a match record and notify both users</p><p>INSERT INTO matches (user_id_1, user_id_2) VALUES (LEAST(A,B), GREATEST(A,B));</p></div><p>At scale: the mutual-like check is a hot query path. Cache it in Redis: SET likes:{B}:{A} 1 on every like. Match detection = GET likes:{B}:{A} &#8212; O(1), &lt; 1ms.</p>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-tinder-matching-walkthrough">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The difference between "Hire" and "Strong Hire"]]></title><description><![CDATA[After the trade-offs section, before the interviewer wraps up, there is a 2-minute move that upgrades a Hire to a Strong Hire more reliably than anything else:]]></description><link>https://systemdr.systemdrd.com/p/the-difference-between-hire-and-strong</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/the-difference-between-hire-and-strong</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 25 Oct 2026 03:30:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!LHHC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>After the trade-offs section, before the interviewer wraps up, there is a 2-minute move that upgrades a Hire to a Strong Hire more reliably than anything else:</strong></p><p>Name two failure modes you haven&#8217;t fixed and the conditions under which you&#8217;d revisit the design.</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>Not generic failure modes. Specific ones from your design.</p><p>&#8220;The two things I&#8217;d revisit: first, if the celebrity threshold for switching from fanout-on-write to fanout-on-read turns out to be lower than 1M followers in practice &#8212; I&#8217;d tune it based on actual write amplification metrics after the first week in production. Second, if the change_log grows faster than anticipated &#8212; I&#8217;d add a compaction job earlier than the 30-day window I assumed.&#8221;</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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LHHC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LHHC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 424w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 848w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 1272w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LHHC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png" width="688" height="489.0659340659341" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1035,&quot;width&quot;:1456,&quot;resizeWidth&quot;:688,&quot;bytes&quot;:638983,&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/220314444?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.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_!LHHC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 424w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 848w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 1272w, https://substackcdn.com/image/fetch/$s_!LHHC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33e140f-f32e-439f-b2bf-fb10dc8be641_3600x2560.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h3>This demonstrates:</h3><p>1. You understand your design is an approximation, not a solution.</p><p>2. You&#8217;ve already thought about the monitoring signals that would tell you it&#8217;s failing.</p><p>3. You know how to respond when it fails.</p><p>That&#8217;s the entire difference between a candidate who has read about systems and a candidate</p><p>who has been on-call for them.</p><p><strong>CTA:</strong> The cohort curriculum goes beyond textbook designs &#8212; training you to proactively identify specific failure modes, establish clear production monitoring thresholds, and articulate exact trigger conditions for revisiting architecture before an interviewer even asks.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>This free lesson is designed to get you started.</strong> </p><p>The paid content helps you master the topic with structured deep dives.</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 Log Aggregation System (ELK/Splunk) — Walkthrough]]></title><description><![CDATA[Archetype: Infrastructure & Platform &#183; Asked at: Elastic, Splunk, Datadog, FAANG-wide]]></description><link>https://systemdr.systemdrd.com/p/design-a-log-aggregation-system-elksplunk</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-log-aggregation-system-elksplunk</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 20 Oct 2026 03:30:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!H0H8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8b8543-db7b-442e-8716-7f7c23f18f9f_4750x4500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>Logs are high-volume, write-once, read-rarely data. The system must ingest millions of log lines per second, store them durably, and make them searchable within seconds. The tension: write throughput (sequential append) vs search (inverted index, which requires knowing content in advance).</p></blockquote><h2>Step 1 &#8212; Clarify</h2><p>- Ingestion rate: 1M log lines/sec (large deployment)</p><p>- Average log size: 500 bytes &#8594; 500 MB/sec ingestion bandwidth</p><p>- Search SLO: search across last 24h of logs within 5 seconds</p><p>- Retention: 30 days hot (searchable), 1 year cold (archive)</p><p>- Structured (JSON) logs or unstructured (free text)?</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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; <strong><a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">Get the 52 FAANG Question Vault</a></strong></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>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-log-aggregation-system-elksplunk">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Indexes: B-Tree, Hash, Composite, Covering]]></title><description><![CDATA[Indexes are the most commonly mentioned and least explained element in system design interviews.]]></description><link>https://systemdr.systemdrd.com/p/indexes-b-tree-hash-composite-covering</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/indexes-b-tree-hash-composite-covering</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Sun, 18 Oct 2026 03:30:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!B_qk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Indexes are the most commonly mentioned and least explained element in system design interviews. &#8220;I&#8217;d add an index on user_id&#8221; is a complete sentence in most answers. It tells the interviewer almost nothing.</p><p>Here&#8217;s the complete framework for talking about indexes in an interview &#8212; specific enough to signal expertise, concise enough to not derail the conversation.</p><h3><strong>B-tree index (the default)</strong></h3><p>A B-tree index stores values in sorted order as a balanced tree. Lookups, range queries, and ORDER BY operations all use it efficiently.</p><p>Use for: equality queries (<code>WHERE user_id = 123</code>), range queries (<code>WHERE created_at BETWEEN x AND y</code>), sorting (<code>ORDER BY created_at DESC</code>).</p><p>The B-tree is the default index type in Postgres, MySQL, and most relational databases. When you say &#8220;I&#8217;d add an index&#8221; without specifying a type, this is what you&#8217;re getting.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B_qk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B_qk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 424w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 848w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 1272w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B_qk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png" width="1456" height="1003" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1003,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:909005,&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/219533285?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.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_!B_qk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 424w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 848w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 1272w, https://substackcdn.com/image/fetch/$s_!B_qk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F723a461f-6555-4f90-bfd0-7a5e86f12fcb_3600x2480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h3><strong>Hash index</strong></h3><p>A hash index maps each value to a hash. Lookups by exact equality are O(1). Range queries are impossible &#8212; the hash has no ordering.</p><p>Use for: pure equality lookups where range queries will never be needed. Session ID lookups. Token validation. Cache key lookups.</p><p>In practice: Redis and most key-value stores use hash indexes internally. Postgres supports hash indexes but they&#8217;re rarely the right choice over B-tree because B-tree handles both equality and range queries while hash handles only equality.</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><h3><strong>Composite index</strong></h3><p>A composite index covers multiple columns: <code>CREATE INDEX ON orders (user_id, status, created_at)</code>.</p><p>The critical rule: <strong>composite indexes follow the left-prefix rule.</strong> This index serves queries on <code>(user_id)</code>, <code>(user_id, status)</code>, and <code>(user_id, status, created_at)</code>. It does NOT serve queries on <code>(status)</code> alone or <code>(created_at)</code> alone.</p><p>Use for: queries that always filter by a leading column and sometimes filter by subsequent columns. &#8220;Give me all pending orders for user X from the last 7 days&#8221; &#8212; <code>(user_id, status, created_at)</code> is the right index.</p><p>The order of columns in a composite index matters: put the most selective columns first if you want to cover a range of queries, or put the equality predicates before the range predicates.</p><h3><strong>Partial index</strong></h3><p>A partial index covers only a subset of rows, defined by a WHERE clause.</p><p><code>CREATE INDEX ON orders (created_at) WHERE status = 'pending'</code></p><p>This index only stores rows where status is &#8216;pending&#8217;. It&#8217;s much smaller than a full index on created_at. Queries that filter by <code>status = 'pending'</code> and then sort by created_at will use this index. Queries that don&#8217;t filter by status won&#8217;t.</p><p>Use for: high-cardinality tables where most queries filter on the same condition. &#8220;Show pending orders&#8221; is a common query; &#8220;show completed orders&#8221; is rare. Index the pending subset specifically.</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><h3><strong>Covering index</strong></h3><p>A covering index includes all columns needed to satisfy a query, so the database can answer the query entirely from the index without touching the underlying table.</p><p>If your query is <code>SELECT user_id, status FROM orders WHERE user_id = 123</code>, an index on <code>(user_id, status)</code> is a covering index &#8212; it has both columns. The query engine never touches the orders table rows.</p><p>The performance difference is significant: a covering index means one I/O operation (read the index), not two (read the index, then follow the pointer to the table row for each result).</p><p>Use for: frequently-run queries on large tables where you want to eliminate the table access entirely. Add the extra columns at the cost of a slightly larger index.</p><h3><strong>How to talk about indexes in an interview</strong></h3><p>The right pattern: identify the hot queries first, then derive the indexes.</p><p>&#8220;The hot query is: all pending orders for a given user, sorted by creation time. I&#8217;d create a composite index on <code>(user_id, status, created_at)</code>. This serves the user_id equality, the status equality, and the created_at range all from one index. I&#8217;d make it a partial index filtered to status=&#8217;pending&#8217; to reduce the index size since orders spend very little time in pending state at scale.&#8221;</p><p>Four sentences. Names the query. Names the index type. Names the column order reasoning. Names the optimization.</p><p>That&#8217;s the L5 format for any index discussion. L6 adds: name the trade-off (write overhead &#8212; every INSERT and UPDATE on the indexed columns must also update the index) and the conditions under which you&#8217;d remove it (if write performance degrades and the query is no longer hot).</p><p><strong>CTA</strong>: The cohort curriculum goes beyond surface-level statements &#8212; walking through exact index selection for high-throughput queries, ordering composite keys, leveraging partial and covering indexes to drop table read I/O, and evaluating the write-amplification trade-offs at scale.</p><h2><strong>Subscription link</strong></h2><p><a href="https://systemdr.systemdrd.com/subscribe">https://systemdr.systemdrd.com/subscribe</a></p><p><strong>Interested in mastering this topic?</strong> Unlock premium content with deeper explanations and real implementation patterns.</p>]]></content:encoded></item><item><title><![CDATA[Design a Distributed Task Queue (Celery/SQS) — Walkthrough]]></title><description><![CDATA[Archetype: Infrastructure & Platform &#183; Asked at: Amazon, Shopify, Stripe]]></description><link>https://systemdr.systemdrd.com/p/design-a-distributed-task-queue-celerysqs</link><guid isPermaLink="false">https://systemdr.systemdrd.com/p/design-a-distributed-task-queue-celerysqs</guid><dc:creator><![CDATA[System Design Roadmap]]></dc:creator><pubDate>Tue, 13 Oct 2026 03:31:40 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0kDF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The probe</h2><blockquote><p>A task queue decouples work submission from work execution. The key systems design problems: at-least-once vs exactly-once delivery, task visibility timeout (what happens if a worker dies mid-task), retry with backoff, and dead-letter queues.</p></blockquote><h2>Step 1 &#8212; Clarify</h2><p>- At-least-once or exactly-once task execution? (At-least-once is standard &#8212; tasks must be idempotent)</p><p>- Priority queues? (Yes &#8212; critical tasks jump the queue)</p><p>- Task timeout (maximum execution time before considering a worker dead)? - Retry policy (max attempts, backoff strategy)?</p><p>- Dead-letter queue for permanently failed tasks?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0kDF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0kDF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 424w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 848w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 1272w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0kDF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png" width="1456" height="1379" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1379,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1578628,&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/218298475?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.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_!0kDF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 424w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 848w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 1272w, https://substackcdn.com/image/fetch/$s_!0kDF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0f25006-dcf0-43c8-850a-bd3bf1fa8ed1_4750x4500.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button class="pencraft pc-reset pencraft icon-container restack-image buttonBase-tqxFUX" tabindex="0" type="button"><svg aria-hidden="true" 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" class="icon-noB79L"><g><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 class="pencraft pc-reset pencraft icon-container view-image buttonBase-tqxFUX" tabindex="0" type="button"><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 icon-noB79L"><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><h2>Step 2 &#8212; Data Model</h2><p>tasks table:</p><p>task_id (UUID), queue_name, payload (JSON), status</p><p>(queued/in_progress/completed/failed/dead),</p><p>priority (int), attempt_count, max_attempts, visibility_timeout_at, next_attempt_at, created_at, completed_at, error_message</p><div class="callout-block" data-callout="true"><p><strong><mark data-color="rgb(255, 255, 0)" 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; <strong><a href="https://systemdrd.com/ebooks/52-faang-questions-drillcards-cheatsheets/">Get the 52 FAANG Question Vault</a></strong></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://systemdr.systemdrd.com/subscribe&quot;,&quot;text&quot;:&quot;Get a 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 a Access to Github Repo</span></a></p>
      <p>
          <a href="https://systemdr.systemdrd.com/p/design-a-distributed-task-queue-celerysqs">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>