Grokking the Coding Interview: Patterns for Coding
Questions
Pattern: Sliding Window (11)
Maximum Sum Subarray of Size K (easy): new (link)
Smallest Subarray with a given sum (easy): LC 209
Longest Substring with K Distinct Characters (medium): LC 340
Fruits into Baskets (medium): LC 904
No-repeat Substring (hard): LC 3
Longest Substring with Same Letters after Replacement (hard): LC 424
Longest Subarray with Ones after Replacement (hard): LC 1004
Problem Challenge 1: LC 567
Problem Challenge 2: LC 438
Problem Challenge 3: LC 76
Problem Challenge 4: LC 30
Pattern: Two Pointers (11)
Pair with Target Sum (easy): LC1
Remove Duplicates (easy): LC 26
Squaring a Sorted Array (easy): LC 977
Triplet Sum to Zero (medium): LC 15
Triplet Sum Close to Target (medium): LC 16
Triplets with Smaller Sum (medium): LC 259
Subarrays with Product Less than a Target (medium): LC 713
Dutch National Flag Problem (medium): LC 75
Problem Challenge 1: LC 18
Problem Challenge 2: LC 844
Problem Challenge 3: LC 581
Pattern: Fast & Slow pointers (7)
LinkedList Cycle (easy): LC 141
Start of LinkedList Cycle (medium): LC 142
Happy Number (medium): LC 202
Middle of the LinkedList (easy): LC 876
Problem Challenge 1: LC 234
Problem Challenge 2: LC 143
Problem Challenge 3: LC 457
Pattern: Merge Intervals (7)
Merge Intervals (medium): LC 56
Insert Interval (medium): LC 57
Intervals Intersection (medium): LC 986
Conflicting Appointments (medium): LC 252
Problem Challenge 1: LC 253
Problem Challenge 2: new (link)
Problem Challenge 3: LC 759
Pattern: Cyclic Sort (8)
Cyclic Sort (easy): new (link)
Find the Missing Number (easy): LC 268
Find all Missing Numbers (easy): LC 448
Find the Duplicate Number (easy): LC 287
Find all Duplicate Numbers (easy): LC 442
Problem Challenge 1: LC 645
Problem Challenge 2: LC 41
Problem Challenge 3: new (link)
Pattern: In-place Reversal of a LinkedList (5)
Reverse a LinkedList (easy): LC 206
Reverse a Sub-list (medium): LC 92
Reverse every K-element Sub-list (medium): LC 25
Problem Challenge 1: new (link)
Problem Challenge 2: LC 61
Pattern: Tree Breadth First Search (9)
Binary Tree Level Order Traversal (easy): LC 102
Reverse Level Order Traversal (easy): LC 107
Zigzag Traversal (medium): LC 103
Level Averages in a Binary Tree (easy): LC 637
Minimum Depth of a Binary Tree (easy): LC 111, LC 104
Level Order Successor (easy): new (link)
Connect Level Order Siblings (medium): LC 117
Problem Challenge 1: new (link)
Problem Challenge 2: LC 199
Pattern: Tree Depth First Search (7)
Binary Tree Path Sum (easy): LC 112
All Paths for a Sum (medium): LC 113, LC 257, new (link)
Sum of Path Numbers (medium): LC 129
Path With Given Sequence (medium): LC 1430
Count Paths for a Sum (medium): LC 437
Problem Challenge 1: LC 543
Problem Challenge 2: LC 124
Pattern: Two Heaps (4)
Find the Median of a Number Stream (medium): LC 295
Sliding Window Median (hard): LC 480
Maximize Capital (hard): LC 502
Problem Challenge 1: LC 436
Pattern: Subsets (9)
Subsets (easy): LC 78
Subsets With Duplicates (easy): LC 90
Permutations (medium): LC 46
String Permutations by changing case (medium): LC 784
Balanced Parentheses (hard): LC 22
Unique Generalized Abbreviations (hard): LC 320
Problem Challenge 1: LC 241
Problem Challenge 2: LC 95
Problem Challenge 3: LC 96
Pattern: Modified Binary Search (10)
Order-agnostic Binary Search (easy): new (Approach 1 in link)
Ceiling of a Number (medium): new (link)
Next Letter (medium): LC 744
Number Range (medium): LC 34
Search in a Sorted Infinite Array (medium): LC 702
Minimum Difference Element (medium): LC 658 (k == 1)
Bitonic Array Maximum (easy): new (link)
Problem Challenge 1: new (link)
Problem Challenge 2: LC 33, LC 81
Problem Challenge 3: LC 153, LC 154
Pattern: Bitwise XOR (4)
Single Number (easy): LC 136
Two Single Numbers (medium): LC 260
Complement of Base 10 Number (medium): LC 476
Problem Challenge 1: LC 832
Pattern: Top 'K' Elements (14)
Top 'K' Numbers (easy): new (link)
Kth Smallest Number (easy): LC 215 (smallest instead of largest)
'K' Closest Points to the Origin (easy): LC 973
Connect Ropes (easy): LC 1167
Top 'K' Frequent Numbers (medium): LC 347
Frequency Sort (medium): LC 451
Kth Largest Number in a Stream (medium): LC 703
'K' Closest Numbers (medium): LC 658
Maximum Distinct Elements (medium): new (link)
Sum of Elements (medium): new (link)
Rearrange String (hard): LC 767
Problem Challenge 1: LC 358
Problem Challenge 2: LC 621
Problem Challenge 3: LC 895
Pattern: K-way merge (5)
Merge K Sorted Lists (medium): LC 23
Kth Smallest Number in M Sorted Lists (Medium): new (link)
Kth Smallest Number in a Sorted Matrix (Hard): LC 378
Smallest Number Range (Hard): LC 632
Problem Challenge 1: LC 373 (largest sum instead of smallest sum)
Pattern : 0/1 Knapsack (Dynamic Programming) (6)
0/1 Knapsack (medium): new (link)
Equal Subset Sum Partition (medium): LC 416
Subset Sum (medium): new (link)
Minimum Subset Sum Difference (hard): new (link)
Problem Challenge 1: new (link)
Problem Challenge 2: LC 494
Pattern: Topological Sort (Graph) (7)
Topological Sort (medium): new (link)
Tasks Scheduling (medium): LC 207
Tasks Scheduling Order (medium): LC 210
All Tasks Scheduling Orders (hard): LC 210 (output all possible solutions)
Alien Dictionary (hard): LC 269
Problem Challenge 1: LC 444
Problem Challenge 2: LC 310
Miscellaneous (1)
Kth Smallest Number (hard): LC 215 (smallest instead of largest)