Coding interview prep courses and platforms like Leetcode often provide only a limited overview of data structures and algorithm patterns, leaving gaps in knowledge when encountering unfamiliar problems.
They typically cover only a few patterns per data structure and expect developers to identify patterns independently through practice.
Previously, it was challenging to find a comprehensive list of these patterns online.
This repository uses ChatGPT to offer a complete list of essential algorithms for coding interviews.
- Two pointers
- Sliding window
- Binary search
- Prefix sums
- Sorting and Greedy Algos
- Backtracking
- Dynamic Programming on Arrays
- Monotonic Stack
- Kadane's Algo
- Dutch national flag algo
- Merge Intervals
- Level Order Traversal of a Tree
- Shortest Path in an Unweighted Graph
- Connected Components in a Graph
- Find Min Depth of Binary Tree
- Word Ladder Problem
- Basic Binary Search
- Finding the Leftmost (First) Occurence
- Finding the Rightmost (Last) Occurence
- Finding the Smallest Element Greater than or equal to target
- Finding the Largest Element Less than or equal to target
- Rotated Sorted Array Search
- Tree Traversals
- Level-Order Traversal
- Height of a Tree
- Checking for a Balanced Tree
- Finding a Node
- Inserting a Node
- Deleting a Node
- Lowest Common Ancestor (LCA)
- Insertion
- Search
- Deletion
- Traversal
- Finding Min and Max
- Graph Traversal with Stack
- Graph Traversal Recursive
- Tree Traversal Preorder
- Tree Traversal Inorder
- Tree Traversal Postorder
- Graph Cycle Detection
- Graph Topological Sort
- Graph Find Connected Components
- Memoization (Top-Down Approach)
- Tabulation (Bottom-Up Approach)
- State and Transition
- Space Optimization
- Combinatorial Problems
- Matrix Chain Multiplication
- BFS
- Topological Sort
- Union-Find (Disjoint Set)
- Shortest Path (Dijkstra Algo)
- Shortest Path (Bellman-Ford Algo)
- Min Spanning Tree (Kruskal's Algo)
- Min Spanning Tree (Prim's Algo)
- Special Graphs (Bipartite Graph)
- Counting Frequencies
- Two Sum Problem
- Group Anagrams
- Find Duplicates
- Intersection of Two Arrays
- Longest Consecutive Sequence
- Subarray Sum Equals K
- Top K Frequent Elements
- Valid Sudoku
- Word Pattern
- Kth largest/smallest element
- Merge K Sorted Lists
- Top K frequent elements
- Find Median Data Stream
- Task Scheduler
- Reorganize String
- Meeting Rooms II
- Sort Characters by Frequency
- Two Pointers (Fast and Slow)
- Reverse Linked List
- Merged Lists
- Cycle detection removal
- Removing N-th node from end
- Finding intersection of two linked lists
- Palindrome Check
- Flattening Multilevel Doubly Linked List
- Sorting an Array
- Count Inversions
- Merge K Sorted Arrays
- Find Kth Smallest Element
- Find Kth Largest Element
- Sort Linked List using Merge Sort
- BFS
- Sliding Window Max
- Rotting Oranges
- Implement Queue using Stacks
- Circular Queue
- Course Schedule (Topological Sort)
- Binary Tree Right Side View
- In-Place Sorting
- Custom Comparator
- Edge Cases
- Iterative Quicksort
- Factorial (Base Case and Recursive Case)
- Fibonacci (Tree Recursion)
- Tail Recursion (Optimized Factorial)
- Backtracking (N-Queens)
- Memoization (Optimized Fibonacci)
- Balanced Parentheses
- Next Greater Element
- Min Stack
- Evaluate Reverse Polish Notation
- Daily Temperatures
- Simplify Path
- Decode String
- Largest Rectangle in Histogram