<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mike H</title>
    <description>The latest articles on DEV Community by Mike H (@mike_h_aef68ed6bf3417956d).</description>
    <link>https://dev.to/mike_h_aef68ed6bf3417956d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3992144%2F86411d73-b731-44f0-9281-5055ec5f6136.png</url>
      <title>DEV Community: Mike H</title>
      <link>https://dev.to/mike_h_aef68ed6bf3417956d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mike_h_aef68ed6bf3417956d"/>
    <language>en</language>
    <item>
      <title>The 15 LeetCode patterns that cover ~90% of coding interviews</title>
      <dc:creator>Mike H</dc:creator>
      <pubDate>Fri, 19 Jun 2026 08:28:21 +0000</pubDate>
      <link>https://dev.to/mike_h_aef68ed6bf3417956d/the-15-leetcode-patterns-that-cover-90-of-coding-interviews-2abb</link>
      <guid>https://dev.to/mike_h_aef68ed6bf3417956d/the-15-leetcode-patterns-that-cover-90-of-coding-interviews-2abb</guid>
      <description>&lt;p&gt;Grinding 500 LeetCode problems is the slow way to prep. The fast way is &lt;strong&gt;pattern recognition&lt;/strong&gt; — because most interview questions are a remix of ~15 underlying patterns. Once you can name the pattern in the first 30 seconds, you stop solving from scratch and start adapting a template you already know.&lt;/p&gt;

&lt;p&gt;Here are the 15 that, in my experience, cover the vast majority of what actually shows up. For each: the &lt;strong&gt;signal&lt;/strong&gt; that tells you to reach for it, and a representative problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 15 patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Sliding Window&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; a contiguous subarray/substring, "longest/shortest/at most K." &lt;em&gt;Ex:&lt;/em&gt; Longest Substring Without Repeating Characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Two Pointers&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; a sorted array, or pairs/triplets that sum to a target. &lt;em&gt;Ex:&lt;/em&gt; 3Sum, Container With Most Water.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Fast &amp;amp; Slow Pointers&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; cycles, or finding the middle of a linked list in one pass. &lt;em&gt;Ex:&lt;/em&gt; Linked List Cycle, Happy Number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Merge Intervals&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; overlapping intervals, scheduling, "merge/insert." &lt;em&gt;Ex:&lt;/em&gt; Merge Intervals, Meeting Rooms II.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Cyclic Sort&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; an array of numbers in a known range &lt;code&gt;[1..n]&lt;/code&gt;, find missing/duplicate. &lt;em&gt;Ex:&lt;/em&gt; Find All Numbers Disappeared in an Array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. In-place Linked List Reversal&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; reverse a list (or a sublist) with O(1) space. &lt;em&gt;Ex:&lt;/em&gt; Reverse Linked List II.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. BFS (Tree/Graph)&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; shortest path on an unweighted graph, or level-order traversal. &lt;em&gt;Ex:&lt;/em&gt; Binary Tree Level Order Traversal, Word Ladder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. DFS (Tree/Graph)&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; explore all paths, connected components, backtracking-ish traversal. &lt;em&gt;Ex:&lt;/em&gt; Number of Islands, Path Sum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Two Heaps&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; you need the median of a stream, or to balance "smaller half / larger half." &lt;em&gt;Ex:&lt;/em&gt; Find Median from Data Stream.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Subsets / Backtracking&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; generate all combinations/permutations/subsets. &lt;em&gt;Ex:&lt;/em&gt; Subsets, Permutations, Combination Sum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Modified Binary Search&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; a sorted (or rotated-sorted) input, or "minimize the maximum." &lt;em&gt;Ex:&lt;/em&gt; Search in Rotated Sorted Array, Koko Eating Bananas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Top K Elements&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; "K largest/smallest/most frequent." Reach for a heap. &lt;em&gt;Ex:&lt;/em&gt; Kth Largest Element, Top K Frequent Elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. K-way Merge&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; merge K sorted lists/arrays. &lt;em&gt;Ex:&lt;/em&gt; Merge k Sorted Lists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. Dynamic Programming&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; "count the ways," "min/max cost," or overlapping subproblems. Start with the recurrence. &lt;em&gt;Ex:&lt;/em&gt; Coin Change, Longest Common Subsequence, House Robber.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. Topological Sort&lt;/strong&gt; — &lt;em&gt;Signal:&lt;/em&gt; ordering with dependencies, a DAG, "can you finish?" &lt;em&gt;Ex:&lt;/em&gt; Course Schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to actually study these (so they stick)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Learn the signal, not just the solution.&lt;/strong&gt; For each pattern, write down the &lt;em&gt;words in the prompt&lt;/em&gt; that trigger it. That recognition is the whole game.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do 3–5 problems per pattern, not 50 random ones.&lt;/strong&gt; Depth on one pattern beats breadth across many.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-derive the template from memory.&lt;/strong&gt; If you can rebuild the sliding-window skeleton on a blank page, you own it. If you're copying, you don't yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mix patterns once each is solid.&lt;/strong&gt; Real interviews don't tell you the pattern — practice cold recognition.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal isn't to memorize 500 solutions. It's to walk in able to say, &lt;em&gt;"this is a top-K problem,"&lt;/em&gt; and reach for the heap before you've even finished reading.&lt;/p&gt;

&lt;p&gt;I wrote the &lt;strong&gt;full breakdown — with template code for every pattern, Big-O, and the exact signal-words&lt;/strong&gt; that map a prompt to a pattern — here: &lt;strong&gt;&lt;a href="https://copilotinterview.com/blog/leetcode-patterns-for-interviews" rel="noopener noreferrer"&gt;The 15 LeetCode Patterns That Cover 90% of Coding Interviews&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What pattern trips you up the most? For me it was two-heaps until it suddenly clicked. Curious what yours is.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I work on &lt;a href="https://copilotinterview.com" rel="noopener noreferrer"&gt;CoPilot Interview&lt;/a&gt;, an interview-prep tool — but this pattern list stands entirely on its own, and the linked guide is free to read.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>algorithms</category>
      <category>interview</category>
      <category>career</category>
    </item>
  </channel>
</rss>
