03 September 2025

#DSA

#DSA

Key Concepts


S.No Topic Sub-Topics
1Introduction & ComplexityWhat is DSA, Time Complexity (Big-O), Space Complexity, Best/Average/Worst case, Simple examples
2Arrays BasicsDeclaration & Access, Common operations, Two-pointer technique, Sliding window intro, In-place vs extra space
3Arrays ProblemsSubarray sum, Prefix sums, Kadane's algorithm, Rearrange problems, Dutch National Flag
4Strings BasicsImmutability, Common operations, Character arrays, String builders, Unicode & encodings
5Strings AlgorithmsPattern search (KMP), Rabin-Karp, Anagrams, Palindromes, Trie intro
6Linked ListsSingly vs Doubly, Operations (insert/delete), Reverse list, Fast/Slow pointers, Detect cycle
7Stacks & QueuesLIFO vs FIFO, Implementation using arrays/linked list, Monotonic stack, Circular queue, Applications
8Recursion & BacktrackingRecurrence relations, Call stack, Backtracking patterns, Subset/permutation generation, N-Queens
9Sorting AlgorithmsBubble, Selection, Insertion, Merge sort, Quick sort
10Searching AlgorithmsLinear search, Binary search, Binary search on answer, Search in rotated array, Interpolation search
11Hashing & Hash TablesHash functions, Collision resolution, HashMap/HashSet, Frequency maps, Anagram/counting problems
12Priority Queue & HeapsBinary heap, Insert/extract, Heapify, Kth largest, Heap for merge/k-way
13Trees BasicsBinary tree, Tree traversal (pre/in/post), Height/depth, Recursive vs iterative, Tree representations
14Binary Search Tree (BST)BST properties, Insert/Delete/Search, Lowest common ancestor, Range queries, Balanced vs unbalanced
15Tries (Prefix Trees)Insert/Search, Prefix queries, Autocomplete, Word dictionary, Memory considerations
16Graphs BasicsDirected vs undirected, Adjacency list/matrix, Graph traversal, Connected components, Dense vs sparse
17Graph TraversalBFS, DFS, Tree vs graph traversal, Level order, Parent/Distance tracking
18Shortest Path AlgorithmsDijkstra, Bellman-Ford, SPFA, Weighted vs unweighted, Single-source vs all-pairs
19Minimum Spanning TreeKruskal, Prim, Union-Find intro, Cycle detection, Applications
20Union-Find / Disjoint SetMake/Find/Union, Path compression, Union by rank, Connected components, Offline queries
21Dynamic ProgrammingOverlapping subproblems, Optimal substructure, Memoization vs tabulation, State definition, Simple examples
22Common DP Patterns0/1 Knapsack, Unbounded knapsack, Longest Increasing Subsequence, Longest Common Subsequence, DP on strings
23Advanced DPBitmask DP, DP on trees, Digit DP, Convex hull trick intro, Optimization techniques
24Greedy AlgorithmsGreedy choice property, Activity selection, Huffman coding, Fractional knapsack, Interval scheduling
25Bit ManipulationBit ops (&,|,^,~,<<,>>), Count bits, Lowbit, Bitmask tricks, XOR properties
26Sliding Window & Two PointersFixed window, Variable window, Two-pointer for pairs, Subarray problems, Window optimization
27Prefix/Suffix & Difference ArraysPrefix sums, Suffix sums, Prefix max/min, Range update via diff array, Prefix product
28Segment Tree & Fenwick TreePoint update & range query, Range update & point query, Lazy propagation, Fenwick implementation, Use-cases
29Advanced Graphs & FlowsTopological sort, DAG applications, Max flow (Edmonds-Karp), Min-cut, Matching basics
30Interview Prep & PracticeCommon patterns, Problem-solving checklist, Mock interviews, Platforms (LeetCode, Codeforces), Time-boxed practice

Interview question

Basic Level

  1. What is an algorithm?
  2. Explain Time Complexity and Big-O notation.
  3. What is Space Complexity?
  4. What is an Array?
  5. Difference between Array and Linked List?
  6. What is a Linked List? Types?
  7. What is a Stack? Explain operations.
  8. What is a Queue? Explain types.
  9. Explain postfix, prefix, infix notations.
  10. What is a Hash table?
  11. What is a Tree data structure?
  12. Difference between Binary Tree and Binary Search Tree (BST)?
  13. What is a Graph?
  14. Difference between DFS and BFS.
  15. What is Recursion?
  16. What is Divide and Conquer approach?
  17. Explain Bubble Sort algorithm.
  18. Explain Selection Sort algorithm.
  19. Explain Insertion Sort algorithm.
  20. What is Linear Search?
  21. What is Binary Search?
  22. What is Dynamic Programming (basic definition)?
  23. What is Greedy Algorithm?
  24. What is a Heap?
  25. What is a Hash collision?

Intermediate Level

  1. Explain Merge Sort algorithm and its complexity.
  2. Explain Quick Sort and its complexity.
  3. Explain Two-pointer technique with examples.
  4. Explain Sliding Window technique.
  5. What is Prefix Sum and where is it used?
  6. Explain Kadane?s algorithm.
  7. What is a Circular Linked List?
  8. How do you detect a cycle in a Linked List?
  9. What is a Doubly Linked List?
  10. What is a Priority Queue?
  11. How do you implement a Queue using Stacks?
  12. How do you implement a Stack using Queues?
  13. What is a Trie data structure?
  14. Difference between Tree and Graph.
  15. What is a Balanced Binary Tree?
  16. What is AVL Tree?
  17. What is Red-Black Tree?
  18. Explain Dijkstra?s algorithm.
  19. What is Bellman-Ford algorithm?
  20. Explain Floyd-Warshall algorithm.
  21. What is Kruskal?s algorithm?
  22. What is Prim?s algorithm?
  23. What is Union-Find data structure?
  24. What is Topological Sorting?
  25. What is Backtracking? Give example.

Advanced Level

  1. Explain Segment Tree and its operations.
  2. What is a Fenwick Tree (Binary Indexed Tree)?
  3. Difference between Segment Tree and Fenwick Tree.
  4. Solve: Maximum product subarray.
  5. Solve: Longest increasing subsequence.
  6. Explain Longest Common Subsequence.
  7. What is KMP algorithm?
  8. Explain Rabin-Karp algorithm.
  9. Explain the concept of rolling hash.
  10. What is a Min-Cut and Max-Flow problem?
  11. Explain Edmonds-Karp Algorithm.
  12. Explain Kahn?s algorithm.
  13. Explain A* search algorithm.
  14. What is NP, NP-hard, and NP-complete?
  15. Explain Traveling Salesman Problem.
  16. Explain Bitmask DP with example.
  17. Explain DP on trees.
  18. Explain DP on graphs.
  19. How does binary lifting work?
  20. What is a Sparse Table?
  21. Explain Lowest Common Ancestor problem.
  22. Implement LRU Cache logic.
  23. What is a Bloom Filter?
  24. Explain Consistent Hashing.
  25. Explain Suffix array and Suffix tree.

Expert Level

  1. Solve: Maximum subarray sum for circular array.
  2. Solve: Median of two sorted arrays (log approach).
  3. Solve: Find Kth smallest element in sorted matrix.
  4. Solve: Word ladder shortest path.
  5. Solve: N-Queens problem optimized solution.
  6. Solve: Shortest path in a maze using BFS.
  7. Solve: Course schedule (detect cycle in graph).
  8. Solve: Clone graph problem.
  9. Solve: Regular expression matching (DP).
  10. Solve: Edit distance problem (DP).
  11. Solve: Palindromic subsequence count (DP).
  12. Solve: Max rectangle in binary matrix.
  13. Solve: Largest histogram rectangle.
  14. Solve: Minimum window substring problem.
  15. Solve: Coin change problem variants.
  16. Solve: Sliding window maximum problem.
  17. Solve: Find bridges and articulation points.
  18. Solve: Euler path/circuit check.
  19. Solve: Detect negative cycle in graph.
  20. Solve: Longest path in DAG.
  21. Solve: Kth smallest element using order-statistic tree.
  22. Solve: Streaming median problem.
  23. Solve: Top K frequent elements problem.
  24. Solve: Find strongly connected components (Kosaraju).
  25. Solve: Implement efficient autocomplete system using Trie.

Related Topics