1. Arrays


2. Strings

  • Check if two strings are anagrams.
  • Longest Palindromic Substring.
  • Implement strStr() (substring search).
  • Count and say sequence.
  • Longest Common Prefix.
  • Group Anagrams.
  • Minimum number of characters to make string a palindrome.

3. Two Pointers / Sliding Window

  • Pair with a given sum in sorted array.
  • Move zeroes to the end.
  • Container with most water.
  • Longest Substring Without Repeating Characters.
  • Minimum window substring.
  • Substring with at most K distinct characters.

4. Hashing / HashMap

  • Two Sum / Four Sum / Subarray Sum = K.
  • Longest subarray with 0 sum.
  • Find the first non-repeating character.
  • Count distinct elements in every window of size k.
  • Find the intersection of two arrays.

5. Stacks & Queues

  • Implement a stack using two queues / queue using two stacks.
  • Next Greater Element.
  • Valid Parentheses.
  • Min Stack.
  • Evaluate Reverse Polish Notation.
  • Sliding Window Maximum.
  • Decode String.

6. Linked List

  • Reverse a linked list (Iterative & Recursive).
  • Detect and remove loop in linked list.
  • Merge two sorted linked lists.
  • Find the middle of the linked list.
  • Check if linked list is palindrome.
  • Intersection point of two linked lists.
  • Clone a linked list with random pointers.

7. Binary Trees / Binary Search Trees

  • Inorder / Preorder / Postorder traversal (iterative + recursive).
  • Check if tree is symmetric.
  • Lowest Common Ancestor (LCA).
  • Level Order Traversal / Zigzag Level Order.
  • Validate BST.
  • Construct tree from preorder and inorder.
  • Diameter of Binary Tree.
  • Flatten Binary Tree to Linked List.
  • Kth smallest/largest element in BST.

8. Recursion / Backtracking

  • N-Queens Problem.
  • Sudoku Solver.
  • Subsets / Subsets II.
  • Combination Sum.
  • Generate Parentheses.
  • Word Search in matrix.
  • Rat in a Maze / Knight’s tour.

9. Heap / Priority Queue

  • Kth largest/smallest element.
  • Merge K sorted arrays/lists.
  • Top K frequent elements.
  • Find median from data stream.
  • Sliding window maximum using heap.

10. Searching & Sorting

  • Binary Search (Standard and Variations):
    • Find first and last occurrence.
    • Search in rotated sorted array.
    • Find square root / kth root.
  • QuickSort / MergeSort (understanding + implementation).
  • Count Inversions.
  • Median of two sorted arrays.
  • Kth smallest/largest element using quickselect.

11. Greedy Algorithms

  • Activity Selection Problem.
  • Fractional Knapsack.
  • Job Scheduling with Deadlines.
  • Huffman Encoding.
  • Minimum number of platforms required for trains.
  • Gas Station problem.

12. Graphs

  • BFS / DFS traversal.
  • Detect cycle in graph (Undirected/Directed).
  • Topological Sort.
  • Shortest Path (Dijkstra / Bellman-Ford / Floyd-Warshall).
  • Union-Find (Disjoint Set Union – DSU).
  • Number of Islands / Connected Components.
  • Kruskal’s and Prim’s Algorithm for MST.

13. Dynamic Programming (DP)

  • 0/1 Knapsack Problem.
  • Longest Common Subsequence.
  • Longest Increasing Subsequence.
  • Coin Change (min coins, total ways).
  • Edit Distance.
  • Matrix Chain Multiplication.
  • Rod Cutting Problem.
  • Maximum Profit in Job Scheduling.
  • DP on Trees / Grids.

14. Bit Manipulation


15. Mathematics / Number Theory

  • Comparison of two number without comparison operator
  • Sieve of Eratosthenes.
  • GCD / LCM using Euclidean algorithm.
  • Fast Exponentiation.
  • Modular Inverse.
  • Check for prime / count primes.
  • Count trailing zeroes in factorial.

16. BONUS: System-Oriented & Logical Thinking

Even if not strict DSA, occasionally include:

  • LRU Cache Design.
  • Design Twitter / MinStack / Rate Limiter.
  • Implement Trie / Autocomplete.
  • TinyURL Encoding-Decoding.

chatGPT