Don't Overprep Coding Interviews.: For Your
Don't Overprep Coding Interviews.: For Your
Don't Overprep Coding Interviews.: For Your
for your
Coding Interviews.
DesignGurus.org
➡ What if you don’t like to solve
100s of coding questions before
your interview?
DesignGurus.org
1. Sliding Window
Usage: This algorithmic technique is used when
we need to handle the input data in a specific
window size.
DS Involved: Array, String, HashTable
Sample Problems:
Longest Substring with 'K' Distinct Characters
Fruits into Baskets
DesignGurus.org
2. Islands (Matrix Traversal)
Usage: This pattern describes all the efficient
ways of traversing a matrix (or 2D array).
Sample Problems:
Number of Islands
Flood Fill
Cycle in a Matrix
DesignGurus.org
3. Two Pointers
Usage: This technique uses two pointers to
iterate input data. Generally, both pointers
move in the opposite direction at a constant
interval.
DS Involved: Array, String, LinkedList
Sample Problems:
Squaring a Sorted Array
Dutch National Flag Problem
Minimum Window Sort
DesignGurus.org
4. Fast & Slow Pointers
Sample Problems:
Middle of the LinkedList
Happy Number
Cycle in a Circular Array
DesignGurus.org
5. Merge Intervals
Usage: This technique is used to deal with
overlapping intervals.
DS Involved: Array, Heap
Sample Problems:
Conflicting Appointments
Minimum Meeting Rooms
DesignGurus.org
6. Cyclic Sort
DS Involved: Array
Sample Problems:
Find all Missing Numbers
Find all Duplicate Numbers
Find the First K Missing Positive Numbers
DesignGurus.org
7. In-place Reversal of a LinkedList
DS Involved: LinkedList
Sample Problems:
Reverse every K-element Sub-list
Rotate a LinkedList
DesignGurus.org
8. Breadth-First Search
Sample Problems:
Binary Tree Level Order Traversal
Minimum Depth of a Binary Tree
Connect Level Order Siblings
DesignGurus.org
9. Depth First Search
Sample Problems:
Path With Given Sequence
Count Paths for a Sum
DesignGurus.org
10. Two Heaps
Sample Problems:
Find the Median of a Number Stream
Next Interval
DesignGurus.org
11. Subsets
Sample Problems:
String Permutations by changing case
Unique Generalized Abbreviations
DesignGurus.org
12. Modified Binary Search
DS Involved: Array
Sample Problems:
Ceiling of a Number
Bitonic Array Maximum
DesignGurus.org
13. Bitwise XOR
Sample Problems:
Two Single Numbers
Flip and Invert an Image
DesignGurus.org
14. Top ‘K’ Elements
Sample Problems:
‘K’ Closest Points to the Origin
Maximum Distinct Elements
DesignGurus.org
15. K-way Merge
Sample Problems:
Kth Smallest Number in M Sorted Lists
Kth Smallest Number in a Sorted Matrix
DesignGurus.org
16. 0/1 Knapsack
Sample Problems:
Equal Subset Sum Partition
Minimum Subset Sum Difference
DesignGurus.org
17. Unbounded Knapsack
Sample Problems:
Rod Cutting
Coin Change
DesignGurus.org
18. Fibonacci Numbers
Sample Problems:
Staircase
House Thief
DesignGurus.org
19. Palindromic Subsequence
Sample Problems:
Longest Palindromic Subsequence
Minimum Deletions in a String to make it a
Palindrome
DesignGurus.org
20. Longest Common Substring
Sample Problems:
Maximum Sum Increasing Subsequence
Edit Distance
DesignGurus.org
21. Topological Sort
Sample Problems:
Tasks Scheduling
Alien Dictionary
DesignGurus.org
➡ Follow these techniques to distinguish
yourself from others!
DesignGurus.org