This guide covers the essential topics you should know for Technical Interviews and Competitive Programming (CP). It's structured to help you focus on mastering important data structures, algorithms, and problem-solving techniques.
- Arrays
- Strings
- Linked Lists (Singly, Doubly)
- Stacks
- Queues (Regular, Deque, Priority Queue)
- Heaps (Min-Heap, Max-Heap)
- Hashing (HashMap, HashSet)
- Disjoint Set Union (Union-Find)
- Trees (Binary Tree, Binary Search Tree, AVL Tree, Segment Tree, Fenwick Tree)
- Trie
- Graph (Adjacency List, Adjacency Matrix)
- Heap (Priority Queue)
- Suffix Tree
- AVL Tree / Red-Black Tree
- Matrix (Sparse Matrix)
- Graph Representations (Adjacency List, Adjacency Matrix)
- B+ Tree
- Fenwick Tree (Binary Indexed Tree - BIT)
- Quick Sort
- Merge Sort
- Bubble Sort
- Insertion Sort
- Selection Sort
- Heap Sort
- Counting Sort, Radix Sort, Bucket Sort
- Binary Search
- Linear Search
- Ternary Search
- Exponential Search
- Memoization
- Tabulation
- State Transition, Recursion
- Knapsack Problem (0/1, Unbounded, Fractional)
- Longest Common Subsequence (LCS)
- Longest Increasing Subsequence (LIS)
- Coin Change Problem
- Matrix Chain Multiplication
- Rod Cutting
- Subset Sum Problem
- Activity Selection
- Fractional Knapsack
- Huffman Encoding
- Job Sequencing Problem
- Prim’s Algorithm (MST)
- Kruskal’s Algorithm (MST)
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Dijkstra’s Algorithm (Shortest Path)
- Bellman-Ford Algorithm
- Floyd-Warshall Algorithm (All-Pairs Shortest Path)
- Topological Sort
- Strongly Connected Components (Kosaraju's Algorithm, Tarjan’s Algorithm)
- Kruskal’s Algorithm (Minimum Spanning Tree)
- Prim’s Algorithm (Minimum Spanning Tree)
- Articulation Points and Bridges
- N-Queens Problem
- Sudoku Solver
- Subset Sum Problem
- Permutations and Combinations
- Merge Sort
- Quick Sort
- Binary Search
- Closest Pair of Points
- Strassen’s Matrix Multiplication
- Knuth-Morris-Pratt (KMP) Algorithm (Pattern Matching)
- Rabin-Karp Algorithm (Pattern Matching)
- Manacher’s Algorithm (Longest Palindromic Substring)
- Z-Algorithm (Pattern Matching)
- Suffix Arrays
- Sieve of Eratosthenes
- Prime Factorization
- GCD and LCM (Euclidean Algorithm)
- Fast Exponentiation
- Modular Arithmetic
- Chinese Remainder Theorem
- Permutations and Combinations
- Binomial Coefficient
- Catalan Numbers
- Convex Hull (Graham Scan, Jarvis March)
- Line Intersection
- Point in Polygon Problem
- Polygon Area Calculation
- Sweep Line Algorithms
- Bitwise AND, OR, XOR
- Counting Set Bits (Brian Kernighan's Algorithm)
- Power of Two (Fast Check)
- Finding the Single Non-Repeating Element
- Range Query and Update
- Lazy Propagation
- Range Sum Query
- Range Minimum/Maximum Query
- Interval Addition
- Used to solve problems involving subarrays or substrings.
- Example: Longest Substring Without Repeating Characters
- Used for sorted arrays/linked lists to solve problems efficiently.
- Example: Finding pairs in sorted arrays, trapping rainwater
- Break a problem into smaller sub-problems, solve them independently.
- Example: Merge Sort, Quick Sort, Binary Search
- Make locally optimal choices hoping for a global optimum.
- Example: Activity Selection, Fractional Knapsack
- Search for an optimal solution in a range.
- Example: Finding smallest/largest value satisfying a condition
- Explore all possible solutions, undoing decisions if needed.
- Example: N-Queens Problem, Sudoku Solver
- Use hash tables for efficient storage and lookup.
- Example: Finding duplicates, subset sum problems
- Solve overlapping sub-problems optimally.
- Example: Longest Common Subsequence, Coin Change Problem
- Efficiently answer range queries after preprocessing.
- Example: Range sum queries, range updates
- Difference Array
- Fenwick Tree (Binary Indexed Tree)
- Segment Tree with Lazy Propagation
- Union-Find (Disjoint Set Union)
- Mo’s Algorithm (for Range Queries)
- Bitwise Operations (AND, OR, XOR, etc.)
- Topological Sorting
- Convex Hull
- Sieve of Eratosthenes
- Knuth-Morris-Pratt Algorithm
- Graph Representations: Adjacency List, Adjacency Matrix
- Graph Traversal: BFS, DFS
- Cycle Detection
- Shortest Path Algorithms: Dijkstra, Bellman-Ford, Floyd-Warshall
- Minimum Spanning Tree: Kruskal, Prim
- Heaps / Priority Queue
- Trie
- Graph Traversal (DFS, BFS)
- Disjoint Set Union (Union-Find)
- Convex Hull
- Line Sweep Algorithm
- Segment Intersection
- Activity Selection Problem
- Fractional Knapsack
- Huffman Encoding
Mastering the topics and algorithms listed above will prepare you for both interviews and competitive programming. Understanding the principles behind each algorithm and technique will help you apply them efficiently to solve a variety of problems.