Coding Interview Patterns

Coding Interview Patterns

1. Pattern: Sliding Window

  1. Introduction
  2. Maximum Sum Subarray of Size K (easy)
  3. Smallest Subarray with a given sum (easy) Educative.io
  4. Longest Substring with K Distinct Characters (medium) Educative.io
  5. Fruits into Baskets (medium) LeetCode
  6. No-repeat Substring (hard) LeetCode
  7. Longest Substring with Same Letters after Replacement (hard) LeetCode
  8. Longest Subarray with Ones after Replacement (hard) LeetCode
  9. Problem Challenge 1 - Permutation in a String (hard) Leetcode
  10. Problem Challenge 2 - String Anagrams (hard) Leetcode
  11. Problem Challenge 3 - Smallest Window containing Substring (hard) Leetcode
  12. Problem Challenge 4 - Words Concatenation (hard) Leetcode

2. Pattern: Two Pointers

  1. Introduction
  2. Pair with Target Sum (easy) LeetCode
  3. Remove Duplicates (easy) LeetCode LeetCode LeetCode LeetCode LeetCode
  4. Squaring a Sorted Array (easy) LeetCode
  5. Triplet Sum to Zero (medium) LeetCode
  6. Triplet Sum Close to Target (medium) LeetCode
  7. Triplets with Smaller Sum (medium) LintCode
  8. Subarrays with Product Less than a Target (medium) LeetCode
  9. Dutch National Flag Problem (medium) CoderByte
  10. Problem Challenge 1 - Quadruple Sum to Target (medium) Leetcode
  11. Problem Challenge 2 - Comparing Strings containing Backspaces (medium) Leetcode
  12. Problem Challenge 3 - Minimum Window Sort (medium) Leetcode Ideserve

3. Pattern: Fast & Slow pointers

  1. Introduction emre.me
  2. LinkedList Cycle (easy) Leetcode
  3. Start of LinkedList Cycle (medium) Leetcode
  4. Happy Number (medium) Leetcode
  5. Middle of the LinkedList (easy) Leetcode
  6. Problem Challenge 1 - Palindrome LinkedList (medium) Leetcode
  7. Problem Challenge 2 - Rearrange a LinkedList (medium) Leetcode
  8. Problem Challenge 3 - Cycle in a Circular Array (hard) Leetcode

4. Pattern: Merge Intervals

  1. Introduction Educative.io
  2. Merge Intervals (medium) Educative.io
  3. Insert Interval (medium) Educative.io
  4. Intervals Intersection (medium) Educative.io
  5. Conflicting Appointments (medium) Geeksforgeeks
  6. Problem Challenge 1 - Minimum Meeting Rooms (hard) Lintcode
  7. Problem Challenge 2 - Maximum CPU Load (hard) Geeksforgeeks
  8. Problem Challenge 3 - Employee Free Time (hard) CoderTrain

5. Pattern: Cyclic Sort

  1. Introduction emre.me
  2. Cyclic Sort (easy) Geeksforgeeks
  3. Find the Missing Number (easy) Leetcode
  4. Find all Missing Numbers (easy) Leetcode
  5. Find the Duplicate Number (easy) Leetcode
  6. Find all Duplicate Numbers (easy) Leetcode
  7. Problem Challenge 1 - Find the Corrupt Pair (easy) TheCodingSimplified
  8. Problem Challenge 2 - Find the Smallest Missing Positive Number (medium) Leetcode
  9. Problem Challenge 3 - Find the First K Missing Positive Numbers (hard) TheCodingSimplified

6. Pattern: In-place Reversal of a LinkedList

  1. Introduction emre.me
  2. Reverse a LinkedList (easy) Leetcode
  3. Reverse a Sub-list (medium) Leetcode
  4. Reverse every K-element Sub-list (medium) Leetcode
  5. Problem Challenge 1 - Reverse alternating K-element Sub-list (medium) Geeksforgeeks
  6. Problem Challenge 2 - Rotate a LinkedList (medium) Leetcode

7. Pattern: Tree Breadth First Search

  1. Introduction
  2. Binary Tree Level Order Traversal (easy) Leetcode
  3. Reverse Level Order Traversal (easy) Leetcode
  4. Zigzag Traversal (medium) Leetcode
  5. Level Averages in a Binary Tree (easy) Leetcode
  6. Minimum Depth of a Binary Tree (easy) Leetcode
  7. Maximum Depth of a Binary Tree (easy) Leetcode
  8. Level Order Successor (easy) Geeksforgeeks
  9. Connect Level Order Siblings (medium) Leetcode
  10. Problem Challenge 1 - Connect All Level Order Siblings (medium) Educative
  11. Problem Challenge 2 - Right View of a Binary Tree (easy) Leetcode

8. Pattern: Tree Depth First Search

  1. Introduction
  2. Binary Tree Path Sum (easy) Leetcode
  3. All Paths for a Sum (medium) Leetcode
  4. Sum of Path Numbers (medium) Leetcode
  5. Path With Given Sequence (medium) Geeksforgeeks
  6. Count Paths for a Sum (medium) Leetcode
  7. Problem Challenge 1 - Tree Diameter (medium) Leetcode
  8. Problem Challenge 2 - Path with Maximum Sum (hard) Leetcode

9. Pattern: Two Heaps

  1. Introduction
  2. Find the Median of a Number Stream (medium) Leetcode
  3. Sliding Window Median (hard)
  4. Maximize Capital (hard)

10. Pattern: Subsets

  1. Introduction Educative.io
  2. Subsets (easy) Educative.io
  3. Subsets With Duplicates (easy) Educative.io
  4. Permutations (medium) Educative.io
  5. String Permutations by changing case (medium)
  6. Balanced Parentheses (hard)
  7. Unique Generalized Abbreviations (hard)

11. Pattern: Modified Binary Search

  1. Introduction
  2. Order-agnostic Binary Search (easy) Geeksforgeeks
  3. Ceiling of a Number (medium) Geeksforgeeks-Ceil Geeksforgeeks-Floor
  4. Next Letter (medium) Leetcode
  5. Number Range (medium) Leetcode
  6. Search in a Sorted Infinite Array (medium) Leetcode
  7. Minimum Difference Element (medium) - Find the floor & ceil take the difference, minimum would be the ans
  8. Bitonic Array Maximum (easy) Geeksforgeeks
  9. Problem Challenge 1 - Search Bitonic Array (medium) Leetcode
  10. Problem Challenge 2 - Search in Rotated Array (medium) Leetcode
  11. Problem Challenge 3 - Rotation Count (medium) Geeksforgeeks

12. Pattern: Bitwise XOR

  1. Introduction
  2. Single Number (easy)
  3. Two Single Numbers (medium)
  4. Complement of Base 10 Number (medium)

13. Pattern: Top 'K' Elements

  1. Introduction
  2. Top 'K' Numbers (easy)
  3. Kth Smallest Number (easy)
  4. 'K' Closest Points to the Origin (easy) Leetcode
  5. Connect Ropes (easy)
  6. Top 'K' Frequent Numbers (medium)
  7. Frequency Sort (medium)
  8. Kth Largest Number in a Stream (medium) Leetcode
  9. 'K' Closest Numbers (medium)
  10. Maximum Distinct Elements (medium)
  11. Sum of Elements (medium)
  12. Rearrange String (hard)

14. Pattern: K-way merge

  1. Introduction
  2. Merge K Sorted Lists (medium)
  3. Kth Smallest Number in M Sorted Lists (Medium)
  4. Kth Smallest Number in a Sorted Matrix (Hard) Educative.io
  5. Smallest Number Range (Hard)

15. Pattern : 0/1 Knapsack (Dynamic Programming)

  1. Introduction
  2. 0/1 Knapsack (medium) Geeksforgeeks
  3. Equal Subset Sum Partition (medium) Leetcode
  4. Subset Sum (medium) Geeksforgeeks
  5. Minimum Subset Sum Difference (hard) Geeksforgeeks

16. Pattern: Topological Sort (Graph)

  1. Introduction
  2. Topological Sort (medium) Youtube
  3. Tasks Scheduling (medium) Leetcode-Similar
  4. Tasks Scheduling Order (medium) Leetcode-Similar
  5. All Tasks Scheduling Orders (hard) Leetcode-Similar
  6. Alien Dictionary (hard) Leetcode
  7. Problem Challenge 1 - Reconstructing a Sequence (hard) Leetcode
  8. Problem Challenge 2 - Minimum Height Trees (hard) Leetcode

17. Miscellaneous

  1. Kth Smallest Number (hard)

18. Conclusions

Where to Go from Here Educative.io