<?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[The Coding Interview Gym: Weekly Challenges]]></title><description><![CDATA[Focused coding interview workouts you can do each week. Each challenge targets a specific pattern or skill so you build real interview readiness over time.]]></description><link>https://paulepps.substack.com/s/weekly-challenges</link><image><url>https://substackcdn.com/image/fetch/$s_!sUyV!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd0dab41-b251-4b04-8deb-bc6622d47f9c_1024x1024.png</url><title>The Coding Interview Gym: Weekly Challenges</title><link>https://paulepps.substack.com/s/weekly-challenges</link></image><generator>Substack</generator><lastBuildDate>Wed, 13 May 2026 10:02:40 GMT</lastBuildDate><atom:link href="https://paulepps.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Paul Epps]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[paulepps@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[paulepps@substack.com]]></itunes:email><itunes:name><![CDATA[Paul Epps]]></itunes:name></itunes:owner><itunes:author><![CDATA[Paul Epps]]></itunes:author><googleplay:owner><![CDATA[paulepps@substack.com]]></googleplay:owner><googleplay:email><![CDATA[paulepps@substack.com]]></googleplay:email><googleplay:author><![CDATA[Paul Epps]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Strings and Anagrams Challenge: Group Anagrams]]></title><description><![CDATA[Problem]]></description><link>https://paulepps.substack.com/p/strings-and-anagrams-challenge-group</link><guid isPermaLink="false">https://paulepps.substack.com/p/strings-and-anagrams-challenge-group</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 11 May 2026 06:35:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nifV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nifV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nifV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!nifV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!nifV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!nifV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nifV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png" width="800" height="450" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:701941,&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://paulepps.substack.com/i/197176650?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.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_!nifV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!nifV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!nifV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!nifV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82eec158-603d-4c30-ad88-55732e7b53e5_800x450.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Problem</strong></h2><p>Given an array of strings <code>strs</code>, group the anagrams together. You can return the answer in <strong>any order</strong>.</p><h3><strong>Examples</strong></h3><p><strong>Example 1:</strong></p><pre><code><code>Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat","tan"],["ate","eat","tea"]]
Explanation: 
 * There is no string in strs that can be rearranged to form "bat".
 * The strings "nat" and "tan" are anagrams as they can be rearranged to form each other.
 * The strings "ate", "eat", and "tea" are anagrams as they can be rearranged to form each other.</code></code></pre><p><strong>Example 2:</strong></p><pre><code><code>Input: strs = [""]
Output: [[""]]</code></code></pre><p><strong>Example 3:</strong></p><pre><code><code>Input: strs = ["a"]
Output: [["a"]]</code></code></pre><h3><strong>Constraints</strong></h3><ul><li><p><code>1 &lt;= strs.length &lt;= 10^4</code> </p></li><li><p><code>0 &lt;= strs[i].length &lt;= 100</code> </p></li><li><p><code>strs[i] </code>consists of lowercase English letters.</p></li></ul><div><hr></div><h2><strong>How to participate</strong></h2><p><strong>Drop your solution as a comment (or link a gist)</strong> by May 14, 2026 at noon Pacific Time.</p><p>Include:</p><ul><li><p>Your programming language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><h2><strong>What I&#8217;ll do</strong></h2><p>By May 16, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions</p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div><hr></div><p><strong>Upcoming Wednesday paid post will be a detailed analysis of strings and anagrams: </strong>sorted key O(n * k log k) vs. frequency tuple O(n * k), prime product hashing trick, interview traps</p><div class="callout-block" data-callout="true"><p><strong>If you&#8217;re a paid subscriber</strong>, you also get get exclusive weekly posts and the option to request a private resume/LinkedIn review.</p><p><strong>Not paid yet? You can upgrade here:</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.com/subscribe&quot;,&quot;text&quot;:&quot;Upgrade to paid&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://paulepps.substack.com/subscribe"><span>Upgrade to paid</span></a></p></div><div><hr></div><p><em>&#169; The Coding Interview Gym | paulepps.substack.com</em></p>]]></content:encoded></item><item><title><![CDATA[Prefix Sum Challenge: Subarray Sum Equals K]]></title><description><![CDATA[Problem]]></description><link>https://paulepps.substack.com/p/prefix-sum-challenge-subarray-sum</link><guid isPermaLink="false">https://paulepps.substack.com/p/prefix-sum-challenge-subarray-sum</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 04 May 2026 04:16:11 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="3999" height="2666" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2666,&quot;width&quot;:3999,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Cubes spelling sub on a table with a plant in the background&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&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="Cubes spelling sub on a table with a plant in the background" title="Cubes spelling sub on a table with a plant in the background" srcset="https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1740645581660-a35f5380dc95?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxzdWJhcnJheSUyMHN1bXxlbnwwfHx8fDE3Nzc4Njc4NjR8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@markuswinkler">Markus Winkler</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><h2><strong>Problem</strong></h2><p>Given an array of integers <code>nums</code> and an integer <code>k</code>, return <em>the total number of subarrays whose sum equals to</em> <code>k</code>.</p><p>A subarray is a contiguous <strong>non-empty</strong> sequence of elements within an array.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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>Examples</strong></h3><p><strong>Example 1:</strong></p><pre><code><code>Input: nums = [1,1,1], k = 2
Output: 2</code></code></pre><p><strong>Example 2:</strong></p><pre><code><code>Input: nums = [1,2,3], k = 3
Output: 2</code></code></pre><h3><strong>Constraints</strong></h3><ul><li><p><code>1 &lt;= nums.length &lt;= 2 * 10^4</code> </p></li><li><p><code>-1000 &lt;= nums[i] &lt;= 1000</code> </p></li><li><p><code>-10^7 &lt;= k &lt;= 10^7</code></p></li></ul><div><hr></div><h2><strong>How to participate</strong></h2><p><strong>Drop your solution as a comment (or link a gist)</strong> by May 7, 2026 at noon Pacific Time.</p><p>Include:</p><ul><li><p>Your programming language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><h2><strong>What I&#8217;ll do</strong></h2><p>By May 9, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions</p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div><hr></div><p><strong>Upcoming Wednesday paid post will be a Prefix Sum deep-dive: </strong>sum derivation, cumulative frequency map, 2D prefix sums, running sum vs. extra array.</p><div class="callout-block" data-callout="true"><p><strong>If you&#8217;re a paid subscriber</strong>, you also get a weekly deep&#8209;dive post and the option to request a private resume review.</p><p><strong>Not paid yet? You can upgrade here:</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.com/subscribe&quot;,&quot;text&quot;:&quot;Upgrade to paid&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://paulepps.substack.com/subscribe"><span>Upgrade to paid</span></a></p></div><div><hr></div><p><em>&#169; The Coding Interview Gym | paulepps.substack.com</em></p>]]></content:encoded></item><item><title><![CDATA[Sliding Window Challenge: Longest Substring Without Repeating Characters ]]></title><description><![CDATA[Problem]]></description><link>https://paulepps.substack.com/p/sliding-window-challenge-longest</link><guid isPermaLink="false">https://paulepps.substack.com/p/sliding-window-challenge-longest</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 27 Apr 2026 15:01:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!HDCx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HDCx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HDCx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HDCx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png" width="800" height="450" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:551820,&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://paulepps.substack.com/i/195481466?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.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_!HDCx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!HDCx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5420103-1b0f-4c1c-b0bd-aaf1a8527bfe_800x450.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Problem</strong></h2><p>Given a string <code>s</code>, find the length of the <strong>longest</strong> <strong>substring</strong> without duplicate characters.</p><h3><strong>Examples</strong></h3><p><strong>Example 1:</strong></p><pre><code><strong>Input:</strong> s = &#8220;abcabcbb&#8221;
<strong>Output:</strong> 3
<strong>Explanation:</strong> The answer is &#8220;abc&#8221;, with the length of 3. Note that <code>"bca"</code> and <code>"cab"</code> are also correct answers.</code></pre><p><strong>Example 2:</strong></p><pre><code><strong>Input:</strong> s = &#8220;bbbbb&#8221;
<strong>Output:</strong> 1
<strong>Explanation:</strong> The answer is &#8220;b&#8221;, with the length of 1.</code></pre><p><strong>Example 3:</strong></p><pre><code><strong>Input:</strong> s = &#8220;pwwkew&#8221;
<strong>Output:</strong> 3
<strong>Explanation:</strong> The answer is &#8220;wke&#8221;, with the length of 3.
Notice that the answer must be a substring, &#8220;pwke&#8221; is a subsequence and not a substring.</code></pre><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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>Constraints</strong></h3><ul><li><p><code>0 &lt;= s.length &lt;= 5 * 10^4</code></p></li><li><p><code>s</code> consists of English letters, digits, symbols and spaces.</p></li></ul><div><hr></div><h2><strong>How to participate</strong></h2><p><strong>Drop your solution as a comment (or link a gist)</strong> by April 30, 2026 at noon Pacific Time.</p><p>Include:</p><ul><li><p>Your programming language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><h2><strong>What I&#8217;ll do</strong></h2><p>By May 2, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions</p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div><hr></div><p><strong>Upcoming Wednesday paid post will be a Sliding Window Masterclass: the pattern that solves 20+ interview problems.</strong></p><div class="callout-block" data-callout="true"><p><strong>If you&#8217;re a paid subscriber</strong>, you also get a weekly deep&#8209;dive post and the option to request a private resume review.</p><p><strong>Not paid yet? You can upgrade here:</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.com/subscribe&quot;,&quot;text&quot;:&quot;Upgrade to paid&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://paulepps.substack.com/subscribe"><span>Upgrade to paid</span></a></p></div><div><hr></div><p><em>&#169; The Coding Interview Gym | paulepps.substack.com</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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[Arrays and Two Pointers Challenge: Two Sum]]></title><description><![CDATA[Find the pair]]></description><link>https://paulepps.substack.com/p/arrays-and-two-pointers-challenge</link><guid isPermaLink="false">https://paulepps.substack.com/p/arrays-and-two-pointers-challenge</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 20 Apr 2026 05:10:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-FFO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-FFO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-FFO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-FFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png" width="800" height="450" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:644585,&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://paulepps.substack.com/i/194758575?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.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_!-FFO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!-FFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16a3cc61-6ab1-4f89-9098-edc778240e79_800x450.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Problem</h2><p>Given an array of integers <code>nums</code> and an integer <code>target</code>, return <em>indices of the two numbers such that they add up to </em><code>target</code>.</p><p>You may assume that each input has <em><strong>exactly</strong></em><strong> one solution</strong>, and you may not use the <em>same</em> element twice.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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>You can return the answer in any order.</p><h3>Examples</h3><pre><code><code>Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].</code></code></pre><pre><code><code>Input: nums = [3,2,4], target = 6
Output: [1,2]</code></code></pre><pre><code><code>Input: nums = [3,3], target = 6
Output: [0,1]</code></code></pre><h3>Constraints</h3><ul><li><p><code>2 &lt;= nums.length &lt;= 10^4</code></p></li><li><p><code>-10^9 &lt;= nums[i] &lt;= 10^9</code></p></li><li><p><code>-10^9 &lt;= target &lt;= 10^9</code></p></li><li><p><strong>Only one valid answer exists.</strong></p></li></ul><div><hr></div><h2>How to participate</h2><p><strong>Drop your solution as a comment (or link a gist)</strong> by April 23, 2026 at noon Pacific Time.</p><p>Include:</p><ul><li><p>Your programming language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><p>If you feel ambitious, compare a memoized recursive solution vs a bottom&#8209;up iterative one in terms of complexity and stack&#8209;overflow risk.</p><h2>What I&#8217;ll do</h2><p>By April 25, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions </p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div><hr></div><p><strong>Full breakdown in Wednesday&#8217;s paid post: hash map vs two pointers tradeoffs, follow-up variants, code in Python/Java.</strong> </p><div class="callout-block" data-callout="true"><p><strong>If you&#8217;re a paid subscriber</strong>, you also get a weekly deep&#8209;dive post and the option to request a private resume review.</p><p><strong>Not paid yet? You can upgrade here:</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.com/subscribe&quot;,&quot;text&quot;:&quot;Upgrade to paid&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://paulepps.substack.com/subscribe"><span>Upgrade to paid</span></a></p></div><div><hr></div><p><em>&#169; The Coding Interview Gym | paulepps.substack.com</em></p>]]></content:encoded></item><item><title><![CDATA[Dynamic Programming: Minimum Coins Challenge]]></title><description><![CDATA[Find the minimum number of coins needed to make a specific target amount]]></description><link>https://paulepps.substack.com/p/dynamic-programming-minimum-coins</link><guid isPermaLink="false">https://paulepps.substack.com/p/dynamic-programming-minimum-coins</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 13 Apr 2026 04:49:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4lyQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4lyQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4lyQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4lyQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png" width="800" height="450" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:566908,&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://paulepps.substack.com/i/194033435?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.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_!4lyQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!4lyQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e04448-4faf-407f-b83a-d6e0697abba7_800x450.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Problem</h2><p>Given an array of <strong>coins[]</strong> of size <strong>n</strong> and a target value <strong>sum</strong>, where <strong>coins[i] </strong>represent the coins of different denominations. You have an <strong>infinite supply</strong> of each of the coins. The task is to find the <strong>minimum </strong>number of coins required to make the given value <strong>sum</strong>. If it is not possible to form the sum using the given coins, return <strong>-1</strong>.</p><div><hr></div><p>This naturally invites:</p><ul><li><p>A naive top&#8209;down recursion.</p></li><li><p>A memoized top&#8209;down Dynamic Programming (DP).</p></li><li><p>A bottom&#8209;up tabulation DP.</p></li><li><p>A greedy solution you can analyze and reject.</p><div><hr></div></li></ul><h2>Examples</h2><p><em><strong>Input:</strong> coins[] = [25, 10, 5], sum = 30<br><strong>Output:</strong> 2<br><strong>Explanation :</strong> Minimum 2 coins needed, 25 and 5</em></p><p><em><strong>Input:</strong> coins[] = [9, 6, 5, 1], sum = 19<br><strong>Output: </strong>3<br><strong>Explanation:</strong> 19 = 9 + 9 + 1</em></p><p><em><strong>Input:</strong> coins[] = [5, 1], sum = 0<br><strong>Output: </strong>0<br><strong>Explanation:</strong> For 0 sum, we do not need a coin</em></p><p><em><strong>Input:</strong> coins[] = [4, 6, 2], sum = 5<br><strong>Output: </strong>-1<br><strong>Explanation:</strong> Not possible to make the given sum.</em></p><div><hr></div><h2>Hints</h2><ul><li><p>Try to define <code>f(x)</code> that depends on smaller <code>x</code>.</p></li><li><p>Can you reuse results of <code>f(x)</code> instead of recomputing?</p><div><hr></div></li></ul><h2>How to participate</h2><p>Post your solution as a comment (or link a gist) by April 16, 2026 at noon Pacific Time</p><p>Include:</p><ul><li><p>Your language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><p>If you feel ambitious, compare a memoized recursive solution vs a bottom&#8209;up iterative one in terms of complexity and stack&#8209;overflow risk.</p><h2>What I&#8217;ll do</h2><p>By April 18, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions </p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym publishes weekly coding challenges, challenge reviews, and interview tips for engineers preparing for FAANG and top-tier interviews. If you&#8217;re not subscribed yet, join here:</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><hr></div><p><em>&#169; The Coding Interview Gym | paulepps.substack.com</em></p>]]></content:encoded></item><item><title><![CDATA[Behavioral Interview Challenge]]></title><description><![CDATA[Storytelling for developers]]></description><link>https://paulepps.substack.com/p/behavioral-interview-challenge</link><guid isPermaLink="false">https://paulepps.substack.com/p/behavioral-interview-challenge</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 06 Apr 2026 03:41:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kouh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kouh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kouh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!kouh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!kouh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!kouh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kouh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png" width="800" height="450" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:448452,&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://paulepps.substack.com/i/193021037?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.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_!kouh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 424w, https://substackcdn.com/image/fetch/$s_!kouh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 848w, https://substackcdn.com/image/fetch/$s_!kouh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 1272w, https://substackcdn.com/image/fetch/$s_!kouh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10eb0692-aea7-4d4a-875e-d583d6b7ce06_800x450.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What behavioral interviews measure</strong></h2><p>Behavioral rounds typically probe qualities like communication, teamwork, conflict resolution, ownership, adaptability, and motivation. Interviewers look for evidence in your past stories that you can collaborate effectively, handle setbacks, make informed decisions, and keep learning on the job.</p><h2><strong>Common question types</strong></h2><p>You will usually see a mix of:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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><ul><li><p>&#8220;Tell me about yourself&#8221; and career preference questions (motivation, ambitions, why this company, why you&#8217;re leaving, etc.).</p></li><li><p>Deep dives into items on your resume, such as hardest bug, most challenging project, or work you&#8217;re most proud of.</p></li><li><p>&#8220;Tell me about a time&#8230;&#8221; questions around challenges, conflicts, tight deadlines, failures, and feedback.</p></li><li><p>Culture and collaboration questions about working with difficult teammates, influencing others, and contributing to team success.</p></li></ul><p>Example: &#8220;Tell me about a time you disagreed with a coworker and how you resolved it&#8221; or &#8220;Describe a mistake you made and what you learned.&#8221;</p><div><hr></div><h2><strong>How to participate</strong></h2><p>Submit one behavioral story from your own experience (e.g., conflict, ambiguity, failure) as a comment by April 9, 2026 at noon Pacific Time.</p><h2><strong>What I&#8217;ll do</strong></h2><p>By April 11, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions</p></li><li><p>Written edits and suggestions to tighten stories, emphasize impact and avoid common pitfalls.</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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[BFS/DFS Coding Interview Challenge]]></title><description><![CDATA[Minimum Bridges Between Island Cities]]></description><link>https://paulepps.substack.com/p/bfsdfs-coding-interview-challenge</link><guid isPermaLink="false">https://paulepps.substack.com/p/bfsdfs-coding-interview-challenge</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 30 Mar 2026 03:50:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lwA9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lwA9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lwA9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 424w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 848w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 1272w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lwA9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png" width="797" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:797,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:671784,&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://paulepps.substack.com/i/191640770?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.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_!lwA9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 424w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 848w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 1272w, https://substackcdn.com/image/fetch/$s_!lwA9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d4dd6ad-e558-4159-8e5e-570d23c45b34_797x475.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Problem</h2><p>You are given n<em>n</em> cities labeled from 0 to <em>n</em>&#8722;1.<br>Some pairs of cities are connected by roads, and some pairs are connected by bridges.</p><ul><li><p>Roads are free to use.</p></li><li><p>Each bridge crossing costs 1 token, regardless of direction or distance.</p></li></ul><p>You are also given a starting city <code>start</code>, a destination city <code>target</code>, and an integer <code>k</code> representing how many bridge tokens you have.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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>You can travel:</p><ul><li><p>Along any road edge at zero cost, unlimited times.</p></li><li><p>Along any bridge edge, but in total you may use <strong>at most</strong> <code>k</code> bridges on your entire route.</p></li></ul><p>Return the <strong>minimum number of steps</strong> (edges traversed, roads or bridges) needed to travel from <code>start</code> to <code>target</code> without using more than <code>k</code> bridges. If it is impossible, return <code>-1</code>.</p><p>A &#8220;step&#8221; is traversing a single edge (road or bridge) from one city to a directly connected city.&#8203;</p><h2>Input format</h2><ul><li><p><code>n</code>: integer, number of cities.</p></li><li><p><code>roads</code>: list of pairs <code>[u, v]</code> meaning there is an undirected <strong>road</strong> between <code>u</code> and <code>v</code>.</p></li><li><p><code>bridges</code>: list of pairs <code>[u, v]</code> meaning there is an undirected <strong>bridge</strong> between <code>u</code> and <code>v</code>.</p></li><li><p><code>start</code>: integer in <code>[0, n-1]</code>.</p></li><li><p><code>target</code>: integer in <code>[0, n-1]</code>.</p></li><li><p><code>k</code>: integer, maximum number of bridges you may use.&#8203;</p></li></ul><h2>Assumptions</h2><ul><li><p>The graph can be disconnected.</p></li><li><p>There may be multiple edges between two cities (e.g., both a road and a bridge).</p></li><li><p>No self-loops are given, but the code shouldn&#8217;t rely on that.</p></li><li><p>1&#8804;<em>n</em>&#8804;10^5, total edges up to 2&#8901;10^5.&#8203;</p></li></ul><h2>Example</h2><h3>Input:</h3><ul><li><p><code>n = 5</code></p></li><li><p><code>roads = [[0,1],[1,2]]</code></p></li><li><p><code>bridges = [[0,3],[3,4],[4,2]]</code></p></li><li><p><code>start = 0</code></p></li><li><p><code>target = 2</code></p></li><li><p><code>k = 1</code></p></li></ul><h3>Questions:</h3><ul><li><p>What is the minimum number of steps?</p></li><li><p>Show the actual path and annotate where you spend your one bridge token.</p></li></ul><h3>Answer:</h3><ul><li><p>Path with roads only: <code>0 &#8594; 1 &#8594; 2</code>, 2 steps, 0 bridges.</p></li><li><p>Longer path using bridges: <code>0 &#8594; 3 &#8594; 4 &#8594; 2</code>, 3 steps, 2 bridges (invalid if <code>k = 1</code>).<br>So the correct answer is 2.&#8203;</p></li></ul><div><hr></div><h2>How to participate</h2><p>Post your solution as a comment (or link a gist) by April 2, 2026 at noon Pacific Time</p><p>Include:</p><ul><li><p>Your language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul><h2>What I&#8217;ll do</h2><p>By April 3, I&#8217;ll publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated feedback on selected submissions </p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">The Coding Interview Gym 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[Week 2: Binary Tree/Recursion Coding Interview Challenge]]></title><description><![CDATA[Maximum depth of a binary tree]]></description><link>https://paulepps.substack.com/p/week-2-binary-treerecursion-coding</link><guid isPermaLink="false">https://paulepps.substack.com/p/week-2-binary-treerecursion-coding</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Mon, 23 Mar 2026 04:39:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!csLi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!csLi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!csLi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 424w, https://substackcdn.com/image/fetch/$s_!csLi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 848w, https://substackcdn.com/image/fetch/$s_!csLi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!csLi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!csLi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png" width="565" height="423.75" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1092,&quot;width&quot;:1456,&quot;resizeWidth&quot;:565,&quot;bytes&quot;:2533316,&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://paulepps.substack.com/i/190667288?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.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_!csLi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 424w, https://substackcdn.com/image/fetch/$s_!csLi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 848w, https://substackcdn.com/image/fetch/$s_!csLi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!csLi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc9a42ad-1ce0-42e2-be03-b382e4c67b66_2048x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Problem</h2><p>You&#8217;re given the root of a binary tree.</p><p>Write a recursive function <code>maxDepth(root)</code> that returns the maximum depth (height) of the tree, where an empty tree has depth <code>0</code>.</p><p>You may assume each node has <code>left</code> and <code>right</code> pointers (or <code>null</code>) to its children.</p><p>Pseudocode signature:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;711e8527-712e-4a6a-a998-9a7c4eda2e15&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">function maxDepth(node: TreeNode): integer</code></pre></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">Thanks for reading The Coding Interview Gym! Subscribe for free to receive new posts and support my work.</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></p><h2>Part 1 &#8212; Code</h2><p>Implement <code>maxDepth</code> <strong>recursively</strong>.<br>Do not use any global variables or mutable state outside the function.</p><div><hr></div><h2>Part 2 &#8212; Explain time complexity</h2><p>In 3&#8211;5 sentences, explain the <strong>time complexity</strong> of your recursive solution.</p><p>Your explanation should:</p><ul><li><p>State what work happens in a single call (besides the recursive calls).</p></li><li><p>Argue why every node in the tree is visited exactly once.&#8203;</p></li><li><p>Conclude that the running time is <em>O</em>(<em>n</em>), where <em>n</em> is the number of nodes.</p></li></ul><div><hr></div><h2>Part 3 &#8212; Explain recursion stack depth</h2><p>In another 3&#8211;5 sentences, explain the <strong>space complexity</strong> in terms of the recursion stack.</p><p>Your explanation should:</p><ul><li><p>Describe what one stack frame represents in this function (a call waiting for its children&#8217;s depths).</p></li><li><p>Relate the maximum number of simultaneous frames to the <strong>height</strong> <em>h</em> of the tree, and state that the extra space is <em>O</em>(<em>h</em>).</p></li><li><p>Connect that to shapes of the tree:</p><ul><li><p>Balanced tree: <em>h </em>&#8776; log <em>n</em></p></li><li><p>Worst-case skewed tree: <em>h </em>&#8776; <em>n</em> (so stack space can grow to  <em>O</em>(<em>n</em>)).</p></li></ul></li></ul><p>You can invite readers to submit both their code and their written complexity explanations as their &#8220;interview answer.&#8221;</p><h2>How to participate</h2><ul><li><p>Post your solution as a comment (or link a gist) by noon Pacific Time on March 19, 2026.</p></li><li><p>Include:</p><ul><li><p>Your language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul></li></ul><h2>What I&#8217;ll do</h2><p>On or before March 21, I&#8217;ll:.</p><ul><li><p>Publish a Review &amp; Lessons post with:</p><ul><li><p>Detailed feedback on selected solutions</p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">Thanks for reading The Coding Interview Gym! Subscribe for free to receive new posts and support my work.</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></p>]]></content:encoded></item><item><title><![CDATA[Week 1: Array/String Coding Interview Challenge]]></title><description><![CDATA[Top K Frequent Words]]></description><link>https://paulepps.substack.com/p/week-1-arraystring-coding-interview</link><guid isPermaLink="false">https://paulepps.substack.com/p/week-1-arraystring-coding-interview</guid><dc:creator><![CDATA[Paul Epps]]></dc:creator><pubDate>Tue, 10 Mar 2026 19:52:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!a9aY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a9aY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a9aY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 424w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 848w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a9aY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png" width="602" height="451.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1092,&quot;width&quot;:1456,&quot;resizeWidth&quot;:602,&quot;bytes&quot;:2523931,&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://paulepps.substack.com/i/190544763?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.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_!a9aY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 424w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 848w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!a9aY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a599ead-2f66-4b6b-aa21-7f8a20881042_2048x1536.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Problem</strong></h2><p>You are given an array of strings <code>words</code> and an integer <code>k</code>.<br>Return the <code>k</code> most frequent strings, sorted by:</p><ol><li><p>Descending frequency.</p></li><li><p>For ties, ascending lexicographic order.</p></li></ol><p>Example:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">Thanks for reading The Coding Interview Gym! Subscribe for free to receive new posts and support my work.</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><ul><li><p>Input: <code>words = ["code", "practice", "code", "interview", "practice", "code"]</code>, <code>k = 2</code></p></li><li><p>Output: <code>["code", "practice"]</code></p></li></ul><p><code>words.length</code> can be up to 10^5.<br>Assume <code>1 &#8804; k &#8804; unique(words)</code>.</p><p>Assume Java, Python, C#, Typescript and JavaScript are allowed.</p><h2>How to participate</h2><ul><li><p>Post your solution as a comment (or link a gist) by March 12 @noon Pacific Time.</p></li><li><p>Include:</p><ul><li><p>Your language</p></li><li><p>Brief explanation of your approach</p></li><li><p>Stated complexity</p></li></ul></li></ul><h2>What I&#8217;ll do</h2><p>By March 13, I&#8217;ll:</p><ul><li><p>Pick at least 3 submissions for detailed written feedback.</p></li><li><p>Publish a Review &amp; Lessons post with:</p><ul><li><p>Annotated solutions</p></li><li><p>A clean reference solution</p></li><li><p>Notes on how an interviewer would evaluate your approach.</p></li></ul></li></ul><p>If you&#8217;re short on time this week, at least sketch your approach in prose&#8212;that&#8217;s still valuable practice.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://paulepps.substack.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">Thanks for reading The Coding Interview Gym! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>