0% found this document useful (0 votes)
2 views81 pages

DSA Questions

The document outlines a comprehensive practice roadmap for data structures, specifically focusing on arrays, strings, linked lists, and stacks. Each section is divided into levels with specific goals and a series of problems to solve, progressing from basic concepts to advanced interview-level challenges. The roadmap emphasizes structured learning and mastery of each topic before moving on to the next.

Uploaded by

22it433
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views81 pages

DSA Questions

The document outlines a comprehensive practice roadmap for data structures, specifically focusing on arrays, strings, linked lists, and stacks. Each section is divided into levels with specific goals and a series of problems to solve, progressing from basic concepts to advanced interview-level challenges. The roadmap emphasizes structured learning and mastery of each topic before moving on to the next.

Uploaded by

22it433
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

🧩 ARRAY PRACTICE ROADMAP (SUB-

CONCEPT WISE)
Rule before starting

• Do NOT skip questions


• Solve in given order
• If stuck → try 20–30 min → then see hint

🔹 LEVEL 0: ARRAY BASICS (MUST START HERE)

Goal

Understand indexing, traversal, and basic logic.

Problems (1 → 10)

1. Print all elements of an array


2. Print array in reverse order
3. Find sum of all elements
4. Count even and odd numbers
5. Find maximum element
6. Find minimum element
7. Find average of array
8. Count positive, negative, zero
9. Find index of given element
10. Check if array is empty or not

Move next only if you can code without confusion.


🔹 LEVEL 1: BASIC ARRAY OPERATIONS

Goal

Insertion, deletion, and understanding shifting.

Problems (11 → 20)

11. Insert element at end


12. Insert element at beginning
13. Insert element at given index
14. Delete element from beginning
15. Delete element from end
16. Delete element from given index
17. Delete first occurrence of element
18. Count frequency of each element
19. Copy one array to another
20. Compare two arrays

🔹 LEVEL 2: SEARCHING (LINEAR → BINARY)

Goal

Learn searching logic properly.

Problems (21 → 30)

21. Linear search (iterative)


22. Linear search (count comparisons)
23. Binary search (iterative)
24. Binary search (recursive)
25. Find first occurrence (binary search)
26. Find last occurrence (binary search)
27. Count total occurrences
28. Search in sorted array
29. Check if element exists
30. Find missing number (1 to N)

Binary search only on sorted array

🔹 LEVEL 3: SIMPLE ARRAY LOGIC PROBLEMS

Goal

Build thinking ability.

Problems (31 → 40)

31. Find second largest element


32. Find second smallest element
33. Reverse array (two pointer)
34. Rotate array by 1
35. Rotate array by K
36. Move all zeros to end
37. Move all negatives to one side
38. Separate even and odd
39. Check if array is sorted
40. Remove duplicates (sorted array)

🔹 LEVEL 4: SORTING (STEP-BY-STEP)

Goal

Understand sorting mechanics clearly.

Problems (41 → 50)

41. Bubble sort


42. Optimized bubble sort
43. Selection sort
44. Insertion sort
45. Merge sort
46. Quick sort
47. Sort array in descending order
48. Sort array of 0s, 1s, 2s
49. Find Kth smallest element
50. Sort array by frequency

🔹 LEVEL 5: PREFIX SUM

Goal

Handle range queries efficiently.

Problems (51 → 60)

51. Create prefix sum array


52. Find sum of range (L, R)
53. Multiple range sum queries
54. Check equilibrium index
55. Subarray sum equals K
56. Count subarrays with sum K
57. Longest subarray with sum K
58. Subarray with sum 0
59. Maximum prefix sum
60. Minimum prefix sum

🔹 LEVEL 6: SLIDING WINDOW

Goal

Optimize brute force logic.


Problems (61 → 70)

61. Maximum sum of subarray of size K


62. First negative number in every window
63. Count distinct elements in window
64. Maximum of all subarrays of size K
65. Minimum sum subarray of size K
66. Longest subarray with at most K sum
67. Longest subarray with at most K distinct
68. Rainwater trapping
69. Stock buy and sell (one transaction)
70. Container with most water

🔹 LEVEL 7: ADVANCED ARRAY INTERVIEW PROBLEMS

Goal

Placement + interview readiness.

Problems (71 → 85)

71. Kadane’s Algorithm


72. Majority element (Moore’s Voting)
73. Find duplicate number
74. Find all duplicates
75. Find missing & repeating
76. Merge two sorted arrays (no extra space)
77. Inversion count
78. Subarray product less than K
79. Maximum product subarray
80. Three sum
81. Four sum
82. Longest consecutive sequence
83. Trapping rainwater (optimized)
84. Partition array into equal sum
85. Split array into chunks
✅ ARRAY TOTAL: 85 ORDERED PROBLEMS
This is EXACTLY the style used by:

• serious DSA learners


• placement preparation
• interview cracking roadmap
🧩 STRINGS PRACTICE ROADMAP (SUB-
CONCEPT WISE)

🔹 LEVEL 0: STRING BASICS (FOUNDATION)

Goal

Understand string storage, indexing, and traversal.

Problems (1 → 10)

1. Print a string
2. Print characters one by one
3. Find length of string (without built-in)
4. Count vowels and consonants
5. Count digits, spaces, symbols
6. Convert lowercase to uppercase
7. Convert uppercase to lowercase
8. Compare two strings (without built-in)
9. Copy one string to another
10. Reverse a string

Move next if: no confusion with loops & indexing

🔹 LEVEL 1: BASIC STRING LOGIC

Goal

Build confidence with simple conditions.


Problems (11 → 20)

11. Check if string is palindrome


12. Count frequency of each character
13. Find first occurrence of character
14. Find last occurrence of character
15. Remove spaces from string
16. Replace a character
17. Count words in a string
18. Check if string contains only alphabets
19. Check if string contains only digits
20. Remove all vowels

🔹 LEVEL 2: STRING MANIPULATION

Goal

Modify and transform strings.

Problems (21 → 30)

21. Remove duplicate characters


22. Sort characters in string
23. Reverse words in a string
24. Capitalize first letter of each word
25. Find longest word in string
26. Find shortest word
27. Check if two strings are anagrams
28. Rotate string by K positions
29. Check if string is rotation of another
30. Swap first and last characters
🔹 LEVEL 3: SUBSTRINGS & PATTERNS

Goal

Understand substring logic.

Problems (31 → 40)

31. Print all substrings


32. Count total substrings
33. Check if substring exists
34. Count occurrences of substring
35. Longest substring without repeating characters
36. Longest palindromic substring
37. Shortest substring containing all characters
38. Find all palindromic substrings
39. Count substrings with equal 0s and 1s
40. Lexicographically smallest substring

🔹 LEVEL 4: PATTERN MATCHING ALGORITHMS

Goal

Efficient searching.

Problems (41 → 45)

41. Naive pattern searching


42. KMP algorithm
43. Rabin–Karp algorithm
44. Z-Algorithm
45. Compare all pattern algorithms

Understand why KMP is faster


🔹 LEVEL 5: STACK-BASED STRING PROBLEMS

Goal

Use stack logic with strings.

Problems (46 → 55)

46. Valid parentheses


47. Remove consecutive duplicates
48. Check redundant brackets
49. Reverse string using stack
50. Minimum bracket reversals
51. Longest valid parentheses
52. Remove invalid parentheses
53. Balanced brackets with multiple types
54. String decoding (e.g., 3[a2[c]])
55. Simplify string path

🔹 LEVEL 6: INTERVIEW-LEVEL STRING PROBLEMS

Goal

Placement & competitive readiness.

Problems (56 → 70)

56. Longest common prefix


57. Group anagrams
58. Edit distance
59. Minimum window substring
60. Check isomorphic strings
61. Count and say sequence
62. Roman to integer
63. Integer to Roman
64. String to integer (atoi)
65. Integer to string
66. Compare version numbers
67. Repeated substring pattern
68. Word break problem
69. String permutations
70. String compression

🔹 LEVEL 7: ADVANCED + MIXED

Goal

Master string thinking.

Problems (71 → 85)

71. Longest repeating character replacement


72. Smallest window containing pattern
73. Remove all adjacent duplicates (k times)
74. Longest substring with at most K distinct
75. Count distinct substrings
76. Check if two strings are one edit away
77. Find all permutations of substring
78. Decode ways (DP + string)
79. Shortest common supersequence
80. Longest common subsequence
81. Reorganize string
82. Custom sort string
83. Valid number
84. Backspace string compare
85. Shuffle string
🧩 LINKED LIST PRACTICE ROADMAP
(TOPIC-WISE)

🔹 LEVEL 0: LINKED LIST BASICS (FOUNDATION)

Goal

Understand node, pointer, and memory linking.

Problems (1 → 8)

1. Create a node structure


2. Create a singly linked list
3. Print (traverse) linked list
4. Count number of nodes
5. Search an element in list
6. Find length using recursion
7. Check if list is empty
8. Print linked list in reverse (using recursion)

🔹 LEVEL 1: SINGLY LINKED LIST – INSERTION

Goal

Master pointer manipulation.

Problems (9 → 16)

9. Insert node at beginning


10. Insert node at end
11. Insert node at given position
12. Insert node after given value
13. Insert node before given value
14. Insert in sorted linked list
15. Insert multiple nodes
16. Create linked list from array

🔹 LEVEL 2: SINGLY LINKED LIST – DELETION

Goal

Safe deletion and edge cases.

Problems (17 → 24)

17. Delete first node


18. Delete last node
19. Delete node at given position
20. Delete node by value
21. Delete entire linked list
22. Remove duplicates (sorted list)
23. Remove duplicates (unsorted list)
24. Delete Nth node from end

🔹 LEVEL 3: SINGLY LINKED LIST – TRAVERSAL & LOGIC

Goal

Build thinking with traversal.

Problems (25 → 32)

25. Find middle node


26. Find Nth node from start
27. Find maximum element
28. Find minimum element
29. Count occurrences of a value
30. Check if linked list is sorted
31. Swap two nodes (by data)
32. Swap nodes (by links)

🔹 LEVEL 4: REVERSE LINKED LIST (IMPORTANT)

Goal

Most asked interview topic.

Problems (33 → 38)

33. Reverse linked list (iterative)


34. Reverse linked list (recursive)
35. Reverse first K nodes
36. Reverse linked list in pairs
37. Reverse alternate K nodes
38. Check if linked list is palindrome

🔹 LEVEL 5: CYCLE & INTERSECTION (APPLICATIONS)

Goal

Real interview scenarios.

Problems (39 → 45)

39. Detect loop (Floyd’s cycle detection)


40. Find length of loop
41. Find starting node of loop
42. Remove loop
43. Find intersection point of two lists
44. Merge two sorted linked lists
45. Add two numbers represented by linked list

🔹 LEVEL 6: DOUBLY LINKED LIST

Goal

Two-direction pointer handling.

Problems (46 → 55)

46. Create doubly linked list


47. Traverse forward
48. Traverse backward
49. Insert at beginning
50. Insert at end
51. Insert at given position
52. Delete from beginning
53. Delete from end
54. Delete given node
55. Reverse doubly linked list

🔹 LEVEL 7: CIRCULAR LINKED LIST

Goal

Understand circular references.

Problems (56 → 65)

56. Create circular linked list


57. Traverse circular list
58. Insert at beginning
59. Insert at end
60. Insert at position
61. Delete first node
62. Delete last node
63. Delete specific node
64. Split circular linked list
65. Check if list is circular

🔹 LEVEL 8: ADVANCED & APPLICATION-BASED


PROBLEMS

Goal

Placement + interview readiness.

Problems (66 → 85)

66. Rotate linked list by K


67. Rearrange list (odd-even)
68. Segregate even and odd nodes
69. Sort linked list (merge sort)
70. Flatten linked list
71. Clone linked list with random pointer
72. Remove nodes with greater value on right
73. Multiply two numbers represented as lists
74. Delete nodes having greater value on right
75. Pairwise swap nodes
76. Reorder linked list
77. Find triplet sum in list
78. Intersection of Y-shaped lists
79. LRU cache (using linked list + map)
80. Reverse list using stack
81. Convert binary number in list to decimal
82. Merge K sorted linked lists
83. Partition list around value
84. Remove zero-sum sublists
85. Design browser forward-backward system

✅ LINKED LIST TOTAL: 85 ORDERED


PROBLEMS
This is exactly aligned with:

• Your mentioned topics


• College exams
• Placement interviews
• Real implementation practice
🧩 STACK PRACTICE ROADMAP (TOPIC-
WISE)

🔹 LEVEL 0: STACK CONCEPT (LIFO)

Goal

Understand stack behavior clearly.

Problems (1 → 6)

1. Explain stack using real-life example


2. Identify stack operations (push, pop, peek)
3. Check stack overflow condition
4. Check stack underflow condition
5. Trace stack operations step-by-step
6. Implement stack ADT (logic only)

🔹 LEVEL 1: STACK IMPLEMENTATION USING ARRAY

Goal

Understand memory and index handling.

Problems (7 → 14)

7. Implement stack using array


8. Push operation (array stack)
9. Pop operation (array stack)
10. Peek operation
11. Display stack elements
12. Check if stack is empty
13. Check if stack is full
14. Menu-driven stack program

🔹 LEVEL 2: STACK IMPLEMENTATION USING LINKED


LIST

Goal

Dynamic stack implementation.

Problems (15 → 21)

15. Implement stack using linked list


16. Push operation (LL stack)
17. Pop operation (LL stack)
18. Peek operation
19. Display stack
20. Count number of elements
21. Compare array vs linked list stack

🔹 LEVEL 3: BASIC STACK APPLICATIONS

Goal

Use stack for simple logic.

Problems (22 → 30)

22. Reverse a string using stack


23. Reverse an array using stack
24. Copy stack into another stack
25. Sort a stack
26. Insert element at bottom of stack
27. Delete middle element of stack
28. Find minimum element in stack
29. Implement two stacks in one array
30. Check balanced parentheses

🔹 LEVEL 4: PARENTHESIS MATCHING (IMPORTANT)

Goal

Most common interview question.

Problems (31 → 36)

31. Check valid parentheses ()


32. Check valid brackets {}, [], ()
33. Find redundant brackets
34. Minimum bracket reversals
35. Longest valid parentheses
36. Score of parentheses

🔹 LEVEL 5: EXPRESSION EVALUATION

Goal

Master infix, postfix, prefix expressions.

Problems (37 → 45)

37. Convert infix to postfix


38. Convert infix to prefix
39. Evaluate postfix expression
40. Evaluate prefix expression
41. Check valid expression
42. Operator precedence handling
43. Evaluate expression with multiple digits
44. Expression evaluation using stack
45. Design calculator using stack

🔹 LEVEL 6: ADVANCED STACK PROBLEMS

Goal

Placement-level questions.

Problems (46 → 60)

46. Next greater element


47. Next smaller element
48. Stock span problem
49. Largest rectangle in histogram
50. Maximum area in binary matrix
51. Min stack (O(1) getMin)
52. Implement stack using queue
53. Implement queue using stack
54. Celebrity problem
55. Trapping rainwater (stack method)
56. Remove adjacent duplicates
57. Decode string (e.g. 3[a2[b]])
58. Simplify directory path
59. Asteroid collision
60. Evaluate reverse polish notation

🔹 LEVEL 7: UNDO-REDO & REAL-WORLD APPLICATIONS

Goal

Understand real-life usage.


Problems (61 → 70)

61. Design undo operation using stack


62. Design redo operation using stack
63. Text editor undo-redo simulation
64. Browser back-forward navigation
65. Stack-based history tracking
66. Implement call stack simulation
67. Function call tracing
68. Parenthesis checker for compiler
69. Expression validator
70. Real-time undo system design

🔹 LEVEL 8: MIXED & INTERVIEW-LEVEL STACK


PROBLEMS

Goal

Confidence booster.

Problems (71 → 85)

71. Sort stack using recursion


72. Reverse stack using recursion
73. Find middle element of stack
74. Merge two stacks
75. Check stack permutation
76. Remove K digits
77. Score of parentheses (optimized)
78. Maximum nesting depth
79. Valid string after removals
80. Sum of minimum elements of subarrays
81. Daily temperatures
82. Sliding window maximum (stack + deque)
83. Remove invalid parentheses
84. Longest rectangle of 1s
85. Design special stack (min + max)

✅ STACK TOTAL: 85 ORDERED PROBLEMS


This matches exactly:

• Stack concept (LIFO)


• Array & Linked List implementation
• Push / Pop / Peek
• Expression evaluation
• Parenthesis matching
• Undo–Redo applications
🧩 QUEUE PRACTICE ROADMAP (TOPIC-
WISE)

🔹 LEVEL 0: QUEUE CONCEPT (FIFO)

Goal

Understand queue behavior clearly.

Problems (1 → 6)

1. Explain queue with real-life example


2. Identify enqueue, dequeue, front, rear
3. Check queue overflow condition
4. Check queue underflow condition
5. Trace queue operations step-by-step
6. Implement queue ADT (logic only)

🔹 LEVEL 1: SIMPLE QUEUE (ARRAY IMPLEMENTATION)

Goal

Understand basic queue using array.

Problems (7 → 15)

7. Implement simple queue using array


8. Enqueue operation
9. Dequeue operation
10. Display queue elements
11. Peek front element
12. Peek rear element
13. Check if queue is empty
14. Check if queue is full
15. Menu-driven simple queue program

Observe wasted space problem

🔹 LEVEL 2: CIRCULAR QUEUE

Goal

Solve space wastage issue.

Problems (16 → 25)

16. Explain circular queue concept


17. Implement circular queue using array
18. Enqueue in circular queue
19. Dequeue in circular queue
20. Display circular queue
21. Check full condition
22. Check empty condition
23. Count elements in circular queue
24. Rearrange circular queue
25. Circular queue vs simple queue

🔹 LEVEL 3: QUEUE USING LINKED LIST

Goal

Dynamic queue implementation.


Problems (26 → 33)

26. Implement queue using linked list


27. Enqueue (LL queue)
28. Dequeue (LL queue)
29. Display linked list queue
30. Peek front element
31. Peek rear element
32. Count elements
33. Compare array vs linked list queue

🔹 LEVEL 4: DEQUE (DOUBLE-ENDED QUEUE)

Goal

Insertion and deletion at both ends.

Problems (34 → 42)

34. Explain deque with example


35. Implement deque using array
36. Insert at front
37. Insert at rear
38. Delete from front
39. Delete from rear
40. Display deque
41. Check if deque is full
42. Check if deque is empty

🔹 LEVEL 5: PRIORITY QUEUE

Goal

Understand priority-based processing.


Problems (43 → 50)

43. Explain priority queue


44. Implement priority queue using array
45. Enqueue based on priority
46. Dequeue highest priority element
47. Display priority queue
48. Handle same priority elements
49. Priority queue using linked list
50. Priority queue using heap (basic)

🔹 LEVEL 6: BASIC QUEUE APPLICATIONS

Goal

Real usage of queues.

Problems (51 → 60)

51. Reverse queue using stack


52. Reverse first K elements of queue
53. Generate binary numbers from 1 to N
54. Implement stack using queue
55. Implement queue using stack
56. Interleave first and second half
57. First non-repeating character in stream
58. Sliding window maximum (queue method)
59. Circular tour (petrol pump problem)
60. Hot potato game simulation
🔹 LEVEL 7: ADVANCED & INTERVIEW-LEVEL
APPLICATIONS

Goal

Placement-ready questions.

Problems (61 → 75)

61. LRU cache (queue + map)


62. CPU scheduling using queue
63. Printer queue simulation
64. Ticket counter simulation
65. BFS using queue
66. Level order traversal of tree
67. Rotten oranges problem
68. Distance of nearest cell having 1
69. Flood fill algorithm
70. Snake and ladder problem
71. Design hit counter
72. Design moving average from data stream
73. Task scheduling system
74. Bank queue management system
75. Multi-level feedback queue

🔹 LEVEL 8: MIXED & DESIGN PROBLEMS

Goal

Strong conceptual clarity.

Problems (76 → 85)

76. Design circular buffer


77. Implement deque using linked list
78. Check palindrome using deque
79. Sort queue
80. Merge two queues
81. Find minimum element in queue
82. Queue permutation check
83. Design real-time queue system
84. Event processing system
85. Message queue design (basic)
🧩 RECURSION & BACKTRACKING
PRACTICE ROADMAP

🔹 LEVEL 0: RECURSION BASICS (FOUNDATION)

Goal

Understand how function calls work.

Problems (1 → 8)

1. Print numbers from 1 to N (recursion)


2. Print numbers from N to 1
3. Find factorial of a number
4. Find sum of first N numbers
5. Find Nth Fibonacci number
6. Find power of a number
7. Count digits in a number
8. Sum of digits of a number

🔹 LEVEL 1: HEAD RECURSION vs TAIL RECURSION

Goal

Understand execution order.

Problems (9 → 15)

9. Print numbers using head recursion


10. Print numbers using tail recursion
11. Convert tail recursion to loop
12. Factorial using tail recursion
13. Fibonacci using recursion (tree trace)
14. Count recursive calls
15. Compare time & space of head vs tail

🔹 LEVEL 2: RECURSION ON ARRAYS & STRINGS

Goal

Apply recursion beyond numbers.

Problems (16 → 25)

16. Print array elements using recursion


17. Find sum of array elements
18. Find maximum element in array
19. Check if array is sorted
20. Reverse array using recursion
21. Check palindrome string
22. Remove character from string
23. Replace character in string
24. Print all subsequences of string
25. Count subsequences

🔹 LEVEL 3: CLASSIC RECURSION PROBLEMS

Goal

Build recursive thinking.

Problems (26 → 35)

26. Tower of Hanoi


27. Print all permutations of string
28. Generate all subsets of a set
29. Print binary strings of length N
30. Print balanced parentheses
31. Count ways to climb stairs
32. Josephus problem
33. Generate keypad combinations
34. Find GCD using recursion
35. Check prime using recursion

🔹 LEVEL 4: INTRODUCTION TO BACKTRACKING

Goal

Understand choice → explore → undo.

Problems (36 → 42)

36. Explain backtracking with example


37. Subset generation using backtracking
38. Permutations using backtracking
39. Solve maze paths (basic)
40. All paths in a grid
41. Word search (basic)
42. Combination sum

🔹 LEVEL 5: RAT IN A MAZE (BACKTRACKING)

Goal

Grid-based backtracking mastery.

Problems (43 → 47)

43. Check if path exists


44. Print one valid path
45. Print all possible paths
46. Count total paths
47. Shortest path in maze (basic)

🔹 LEVEL 6: N-QUEENS PROBLEM

Goal

Classic interview backtracking problem.

Problems (48 → 52)

48. Place N queens on chessboard


49. Print one solution
50. Print all solutions
51. Count number of solutions
52. Optimized N-Queens (using arrays)

🔹 LEVEL 7: SUDOKU SOLVER

Goal

Complex constraint backtracking.

Problems (53 → 57)

53. Validate Sudoku board


54. Check safe placement
55. Solve Sudoku (9×9)
56. Count total Sudoku solutions
57. Optimize Sudoku solver
🔹 LEVEL 8: ADVANCED BACKTRACKING & MIXED

Goal

Strong interview readiness.

Problems (58 → 70)

58. Knight’s tour


59. Graph coloring problem
60. Hamiltonian path
61. Crossword puzzle solver
62. Palindrome partitioning
63. Restore IP addresses
64. Word break using backtracking
65. Expression add operators
66. Generate valid IPs
67. Partition into K subsets
68. Remove invalid parentheses
69. Letter tile possibilities
70. Backtracking vs DP comparison

✅ TOTAL: 70 ORDERED PROBLEMS


This roadmap:

• Matches Recursion Basics


• Covers Head vs Tail Recursion
• Deeply covers Backtracking
• Includes Rat in Maze, N-Queens, Sudoku
• Is perfect for college + interviews
🧩 HASHING PRACTICE ROADMAP (TOPIC-
WISE)

🔹 LEVEL 0: HASH TABLE CONCEPT (FOUNDATION)

Goal

Understand what hashing solves.

Problems (1 → 6)

1. Explain hash table with real-life example


2. Identify key, value, hash index
3. Implement a simple hash table (array based)
4. Search element using hashing
5. Delete element from hash table
6. Compare hashing vs linear search

🔹 LEVEL 1: HASH FUNCTIONS

Goal

Understand mapping logic.

Problems (7 → 12)

7. Implement simple modulo hash function


8. Hash function for string keys
9. Analyze good vs bad hash functions
10. Handle negative keys
11. Count collisions for given hash function
12. Choose table size for minimum collisions

🔹 LEVEL 2: COLLISION HANDLING – CHAINING

Goal

Understand linked-list based collision handling.

Problems (13 → 20)

13. Implement hashing with chaining


14. Insert key using chaining
15. Search key using chaining
16. Delete key using chaining
17. Count elements in each chain
18. Load factor calculation
19. Handle duplicate keys
20. Chaining vs open addressing

🔹 LEVEL 3: COLLISION HANDLING – OPEN ADDRESSING

Goal

Index probing techniques.

Problems (21 → 30)

21. Implement linear probing


22. Implement quadratic probing
23. Implement double hashing
24. Search using linear probing
25. Delete element using probing
26. Handle clustering problem
27. Rehashing implementation
28. Compare probing techniques
29. Calculate probe sequence
30. Detect full hash table

🔹 LEVEL 4: BASIC HASHING APPLICATIONS

Goal

Real usage of hash maps.

Problems (31 → 40)

31. Count frequency of elements


32. Count frequency of characters in string
33. Find first non-repeating element
34. Find first repeating element
35. Check if array has duplicates
36. Check if two arrays are equal
37. Count distinct elements
38. Find common elements in two arrays
39. Find intersection of arrays
40. Find union of arrays

🔹 LEVEL 5: TWO-SUM & PAIR PROBLEMS (IMPORTANT)

Goal

Most asked hashing problems.

Problems (41 → 50)

41. Two-Sum (check existence)


42. Two-Sum (return indices)
43. Count pairs with given sum
44. Count pairs with given difference
45. Find pair with zero sum
46. Find pair divisible by K
47. Count subarrays with sum K
48. Longest subarray with sum K
49. Subarray with equal 0s and 1s
50. Count subarrays with XOR K

🔹 LEVEL 6: ADVANCED HASHING PROBLEMS

Goal

Interview-level mastery.

Problems (51 → 65)

51. Longest consecutive sequence


52. Find missing number
53. Find duplicate number
54. Group anagrams
55. Isomorphic strings
56. Word pattern matching
57. Check if two strings are anagrams
58. Top K frequent elements
59. K most frequent words
60. Sort elements by frequency
61. Find all duplicates in array
62. Subarray sum divisible by K
63. Count distinct elements in window
64. Minimum window substring
65. Longest palindrome using hashing
🔹 LEVEL 7: DESIGN & REAL-WORLD APPLICATIONS

Goal

Conceptual clarity + system thinking.

Problems (66 → 75)

66. Design phone book using hashing


67. Cache design using hash map
68. Implement symbol table
69. Spell checker design
70. Dictionary word lookup
71. URL shortening (basic hash idea)
72. Detect duplicates in data stream
73. Find repeating elements in log file
74. Hash-based authentication system
75. Real-time frequency counter

✅ HASHING TOTAL: 75 ORDERED


PROBLEMS
This roadmap:

• Covers Hash table concept


• Includes hash functions
• Deeply covers chaining & open addressing
• Focuses on frequency counting & Two-Sum
• Perfect for college + placements
🧩 TREES PRACTICE ROADMAP (TOPIC-
WISE)

🔹 LEVEL 0: TREE BASICS (FOUNDATION)

Goal

Understand tree terminology & structure.

Problems (1 → 8)

1. Explain tree with real-life example


2. Define root, parent, child, leaf
3. Find height of a tree
4. Count total nodes
5. Count leaf nodes
6. Count internal nodes
7. Check if tree is empty
8. Compare tree vs graph

🔹 LEVEL 1: BINARY TREE CREATION & TRAVERSAL

Goal

Master traversal logic (MOST IMPORTANT).

Problems (9 → 18)

9. Create binary tree manually


10. Preorder traversal (recursive)
11. Inorder traversal (recursive)
12. Postorder traversal (recursive)
13. Preorder traversal (iterative)
14. Inorder traversal (iterative)
15. Postorder traversal (iterative)
16. Level order traversal
17. Level order using queue
18. Print tree level-by-level

🔹 LEVEL 2: BINARY TREE BASIC PROBLEMS

Goal

Build thinking using traversal.

Problems (19 → 30)

19. Find maximum element


20. Find minimum element
21. Find sum of all nodes
22. Find height of binary tree
23. Count nodes using recursion
24. Check if two trees are identical
25. Mirror a binary tree
26. Check if tree is symmetric
27. Print left view
28. Print right view
29. Print top view
30. Print bottom view

🔹 LEVEL 3: BINARY TREE ADVANCED PROBLEMS

Goal

Interview-level logic.
Problems (31 → 45)

31. Diameter of binary tree


32. Check if tree is height balanced
33. Lowest common ancestor (binary tree)
34. Convert tree to doubly linked list
35. Check if tree is sum tree
36. Zig-zag traversal
37. Vertical order traversal
38. Boundary traversal
39. Serialize and deserialize tree
40. Check if tree is subtree of another
41. Flatten binary tree
42. Find distance between two nodes
43. Burn a tree problem
44. Nodes at distance K
45. Maximum path sum

🔹 LEVEL 4: BINARY SEARCH TREE (BST)

Goal

Understand ordered trees.

Problems (46 → 58)

46. Create BST


47. Insert node in BST
48. Search node in BST
49. Delete node in BST
50. Find minimum in BST
51. Find maximum in BST
52. Find inorder predecessor
53. Find inorder successor
54. Check if tree is BST
55. LCA in BST
56. Kth smallest element
57. Kth largest element
58. Convert sorted array to BST

🔹 LEVEL 5: AVL TREE (SELF-BALANCING BST)

Goal

Understand rotations & balancing.

Problems (59 → 65)

59. Calculate balance factor


60. Left rotation
61. Right rotation
62. Insert in AVL tree
63. Delete from AVL tree
64. Check AVL tree balance
65. AVL vs BST comparison

🔹 LEVEL 6: HEAP (MAX HEAP & MIN HEAP)

Goal

Priority-based tree usage.

Problems (66 → 75)

66. Implement max heap


67. Implement min heap
68. Heapify process
69. Insert element in heap
70. Delete root from heap
71. Convert array to heap
72. Heap sort
73. Kth largest element
74. Kth smallest element
75. Priority queue using heap

🔹 LEVEL 7: TRIE (PREFIX TREE)

Goal

Efficient string searching.

Problems (76 → 82)

76. Implement Trie


77. Insert word in Trie
78. Search word in Trie
79. Delete word from Trie
80. Prefix search
81. Auto-complete system
82. Longest common prefix

🔹 LEVEL 8: SEGMENT TREE & FENWICK TREE

Goal

Range queries optimization.

Problems (83 → 95)

83. Build segment tree


84. Range sum query
85. Range minimum query
86. Point update
87. Lazy propagation
88. Segment tree for max query
89. Build Fenwick tree
90. Prefix sum using BIT
91. Update BIT
92. Range query using BIT
93. BIT vs Segment tree
94. Count inversions using BIT
95. Real-time range query system

✅ TREES TOTAL: 95 ORDERED PROBLEMS


This roadmap:

• Covers Tree Basics → Binary Tree → BST → AVL


• Includes Heap, Trie
• Deeply covers Segment Tree & Fenwick Tree
• Is college + interview + competitive ready
🧩 GRAPHS PRACTICE ROADMAP (TOPIC-
WISE)

🔹 LEVEL 0: GRAPH BASICS & REPRESENTATION

Goal

Understand how graphs are stored.

Problems (1 → 8)

1. Explain graph with real-life example


2. Identify vertices and edges
3. Represent graph using adjacency matrix
4. Represent graph using adjacency list
5. Convert adjacency matrix → list
6. Convert adjacency list → matrix
7. Count degree of each vertex
8. Directed vs undirected graph comparison

🔹 LEVEL 1: GRAPH TRAVERSAL – BFS & DFS

Goal

Core graph logic (MOST IMPORTANT).

Problems (9 → 18)

9. BFS traversal (using queue)


10. BFS for disconnected graph
11. DFS traversal (recursive)
12. DFS traversal (iterative)
13. DFS for disconnected graph
14. BFS vs DFS comparison
15. Count connected components
16. Find path between two nodes (BFS)
17. Find path using DFS
18. Print traversal order

🔹 LEVEL 2: GRAPH BASIC PROBLEMS

Goal

Build thinking using traversal.

Problems (19 → 30)

19. Detect cycle in undirected graph (DFS)


20. Detect cycle in undirected graph (BFS)
21. Detect cycle in directed graph (DFS)
22. Detect cycle using indegree method
23. Check if graph is bipartite (BFS)
24. Check if graph is bipartite (DFS)
25. Find number of islands
26. Flood fill algorithm
27. Rotten oranges problem
28. Shortest path in unweighted graph
29. Clone graph
30. Graph coloring (basic)

🔹 LEVEL 3: TOPOLOGICAL SORT

Goal

Ordering in DAG.
Problems (31 → 36)

31. Topological sort using DFS


32. Topological sort using BFS (Kahn’s)
33. Detect cycle using topological sort
34. Course schedule problem
35. Find all topological orders
36. Alien dictionary problem

🔹 LEVEL 4: SHORTEST PATH ALGORITHMS

Goal

Weighted graph mastery.

Problems (37 → 48)

37. Dijkstra’s algorithm (adjacency list)


38. Dijkstra using priority queue
39. Shortest path from source to all nodes
40. Shortest path between two nodes
41. Bellman-Ford algorithm
42. Detect negative weight cycle
43. Floyd-Warshall algorithm
44. All-pairs shortest path
45. Compare Dijkstra vs Bellman-Ford
46. Path reconstruction
47. Network delay time
48. Cheapest flights within K stops
🔹 LEVEL 5: MINIMUM SPANNING TREE (MST)

Goal

Minimum cost connectivity.

Problems (49 → 56)

49. Kruskal’s algorithm


50. Implement Disjoint Set (Union-Find)
51. Path compression in DSU
52. Prim’s algorithm (matrix)
53. Prim’s algorithm (priority queue)
54. Compare Kruskal vs Prim
55. Minimum cost to connect all points
56. MST for disconnected graph

🔹 LEVEL 6: CYCLE DETECTION (DEEP DIVE)

Goal

Handle all graph types.

Problems (57 → 64)

57. Cycle detection in undirected graph (DFS)


58. Cycle detection in undirected graph (BFS)
59. Cycle detection in directed graph
60. Detect cycle using recursion stack
61. Detect cycle using coloring method
62. Find nodes in a cycle
63. Remove extra edge
64. Redundant connection problem
🔹 LEVEL 7: ADVANCED GRAPH APPLICATIONS

Goal

Interview-level scenarios.

Problems (65 → 80)

65. Word ladder


66. Knight’s shortest path
67. Minimum time to collect apples
68. Count paths between nodes
69. Bridges in graph
70. Articulation points
71. Tarjan’s algorithm
72. Kosaraju’s algorithm
73. Strongly connected components
74. Eulerian path & circuit
75. Graph cloning with weights
76. Detect mother vertex
77. Traveling salesman problem (basic)
78. Minimum steps to reach target
79. Find safe states
80. Reorder routes to make paths lead to city zero

✅ GRAPHS TOTAL: 80 ORDERED


PROBLEMS
This roadmap:

• Covers graph representation


• Deeply covers BFS, DFS
• Includes shortest path algorithms
• Covers MST, topological sort, cycle detection
• Strong on applications & interviews
🧩 SEARCHING & SORTING PRACTICE
ROADMAP (TOPIC-WISE)

🔹 LEVEL 0: SEARCHING BASICS (FOUNDATION)

Goal

Understand how searching works and when to use which method.

Problems (1 → 6)

1. Explain searching with real-life example


2. Compare searching vs sorting
3. Identify when linear search is required
4. Identify when binary search is applicable
5. Check if array is sorted
6. Count number of comparisons in search

🔹 LEVEL 1: LINEAR SEARCH

Goal

Simple but important baseline search.

Problems (7 → 15)

7. Implement linear search


8. Search element in unsorted array
9. Search element in sorted array
10. Find index of first occurrence
11. Find index of last occurrence
12. Count occurrences of element
13. Find maximum element using linear search
14. Find minimum element using linear search
15. Search element in string

🔹 LEVEL 2: BINARY SEARCH (VERY IMPORTANT)

Goal

Efficient searching on sorted data.

Problems (16 → 30)

16. Implement binary search (iterative)


17. Implement binary search (recursive)
18. Find first occurrence (binary search)
19. Find last occurrence (binary search)
20. Count total occurrences
21. Search in rotated sorted array
22. Find minimum in rotated array
23. Find peak element
24. Find square root of number
25. Find element in infinite sorted array
26. Floor of element
27. Ceil of element
28. Lower bound
29. Upper bound
30. Check if number exists

🔹 LEVEL 3: TERNARY SEARCH

Goal

Understand divide-into-three searching.


Problems (31 → 35)

31. Explain ternary search


32. Implement ternary search (iterative)
33. Implement ternary search (recursive)
34. Compare binary vs ternary search
35. Ternary search on unimodal function

🔹 LEVEL 4: BASIC SORTING ALGORITHMS

Goal

Understand internal working of sorting.

Problems (36 → 45)

36. Implement bubble sort


37. Optimized bubble sort
38. Implement selection sort
39. Implement insertion sort
40. Sort array in descending order
41. Check stability of sorting
42. Count number of swaps
43. Sort strings alphabetically
44. Sort array of 0s and 1s
45. Sort array of 0s, 1s, 2s

🔹 LEVEL 5: ADVANCED COMPARISON SORTS

Goal

Efficient sorting for large data.


Problems (46 → 60)

46. Implement merge sort


47. Merge two sorted arrays
48. Count inversions using merge sort
49. Implement quick sort
50. Choose pivot strategies
51. Best-case & worst-case of quick sort
52. Sort linked list using merge sort
53. Find Kth smallest element
54. Find Kth largest element
55. Quick select algorithm
56. Compare merge sort vs quick sort
57. Sort array using recursion
58. External sorting concept
59. Stable vs unstable sorting
60. Real-life use of merge sort

🔹 LEVEL 6: HEAP SORT & PRIORITY SORTING

Goal

Sorting using tree structure.

Problems (61 → 68)

61. Build max heap


62. Build min heap
63. Heapify process
64. Implement heap sort
65. Sort nearly sorted array
66. Kth largest using heap
67. K smallest elements
68. Compare heap sort vs quick sort
🔹 LEVEL 7: NON-COMPARISON SORTING

Goal

Linear time sorting techniques.

Problems (69 → 80)

69. Implement counting sort


70. Counting sort for characters
71. Counting sort for range data
72. Implement radix sort
73. Radix sort on integers
74. Radix sort on strings
75. Implement bucket sort
76. Bucket sort for floating numbers
77. Compare counting vs radix
78. Compare radix vs bucket
79. Stability of non-comparison sorts
80. When NOT to use counting sort

🔹 LEVEL 8: MIXED & INTERVIEW-LEVEL PROBLEMS

Goal

Placement-ready mastery.

Problems (81 → 95)

81. Search element in 2D matrix


82. Median of two sorted arrays
83. Aggressive cows problem
84. Allocate minimum pages
85. Painters partition problem
86. Find smallest divisor
87. Find minimum days to make bouquets
88. Binary search on answer
89. Sort array by frequency
90. Custom comparator sorting
91. Relative sorting
92. Check if array can be sorted by swaps
93. Count sort for negative numbers
94. Sorting using lambda
95. Search space optimization problems

✅ SEARCHING & SORTING TOTAL: 95


ORDERED PROBLEMS
This roadmap:

• Covers Linear, Binary, Ternary search


• Includes all sorting algorithms you listed
• Follows easy → advanced → interview
• Perfect for college, placements, competitive coding
🧩 DYNAMIC PROGRAMMING PRACTICE
ROADMAP (TOPIC-WISE)

🔹 LEVEL 0: DP BASICS (FOUNDATION)

Goal

Understand what DP actually is.

Problems (1 → 6)

1. Explain Dynamic Programming in your own words


2. Identify overlapping subproblems
3. Identify optimal substructure
4. Convert recursion to DP idea
5. When to use DP vs recursion
6. DP vs Greedy comparison

🔹 LEVEL 1: RECURSION → DP CONVERSION

Goal

Build DP thinking from recursion.

Problems (7 → 12)

7. Fibonacci using recursion


8. Fibonacci using memoization
9. Fibonacci using tabulation
10. Compare time & space of all three
11. Count number of recursive calls
12. Identify DP states & transitions

🔹 LEVEL 2: MEMOIZATION (TOP-DOWN DP)

Goal

Avoid recomputation using cache.

Problems (13 → 20)

13. Factorial using memoization


14. Climbing stairs (memoization)
15. Minimum cost climbing stairs
16. Frog jump problem
17. House robber (memoization)
18. Coin change (minimum coins – memo)
19. Subset sum (memoization)
20. Target sum (memoization)

🔹 LEVEL 3: TABULATION (BOTTOM-UP DP)

Goal

Build solution iteratively.

Problems (21 → 30)

21. Fibonacci using tabulation


22. Climbing stairs (tabulation)
23. House robber (tabulation)
24. Coin change (number of ways)
25. Subset sum (tabulation)
26. Equal sum partition
27. Rod cutting problem
28. Perfect squares
29. Minimum steps to reach 1
30. DP space optimization

🔹 LEVEL 4: 0/1 KNAPSACK FAMILY (VERY IMPORTANT)

Goal

Master classic DP pattern.

Problems (31 → 40)

31. 0/1 Knapsack (recursive)


32. 0/1 Knapsack (memoization)
33. 0/1 Knapsack (tabulation)
34. Subset sum problem
35. Equal sum partition
36. Count subsets with given sum
37. Minimum subset sum difference
38. Target sum problem
39. Fractional Knapsack (greedy vs DP)
40. Knapsack pattern revision

🔹 LEVEL 5: LONGEST COMMON SUBSEQUENCE (LCS


FAMILY)

Goal

String-based DP mastery.

Problems (41 → 50)

41. LCS (recursive)


42. LCS (memoization)
43. LCS (tabulation)
44. Longest common substring
45. Print LCS
46. Shortest common supersequence
47. Minimum insertions to make palindrome
48. Minimum deletions to make palindrome
49. Edit distance
50. String conversion using LCS

🔹 LEVEL 6: LONGEST INCREASING SUBSEQUENCE (LIS


FAMILY)

Goal

Sequence DP mastery.

Problems (51 → 58)

51. LIS (O(n²))


52. LIS (binary search optimization)
53. Print LIS
54. Longest decreasing subsequence
55. Bitonic subsequence
56. Maximum sum increasing subsequence
57. Russian doll envelopes
58. LIS pattern revision
🔹 LEVEL 7: MATRIX CHAIN MULTIPLICATION (MCM
FAMILY)

Goal

Partition DP understanding.

Problems (59 → 66)

59. Matrix chain multiplication (recursive)


60. MCM (memoization)
61. MCM (tabulation)
62. Palindrome partitioning
63. Boolean parenthesization
64. Minimum cost to cut stick
65. Burst balloons
66. Egg dropping problem

🔹 LEVEL 8: DP ON GRIDS

Goal

2D DP clarity.

Problems (67 → 75)

67. Unique paths


68. Unique paths with obstacles
69. Minimum path sum
70. Triangle minimum path sum
71. Cherry pickup
72. Dungeon game
73. Count square submatrices
74. Maximal square
75. DP on grid revision
🔹 LEVEL 9: DP ON TREES & GRAPHS

Goal

Advanced DP applications.

Problems (76 → 85)

76. DP on tree (height calculation)


77. Tree diameter using DP
78. Maximum path sum in tree
79. Tree DP – house robber
80. DP on DAG (longest path)
81. Shortest path using DP (DAG)
82. Count paths in DAG
83. DP + BFS combination
84. DP + DFS combination
85. DP on trees & graphs revision

✅ DYNAMIC PROGRAMMING TOTAL: 85


ORDERED PROBLEMS
This roadmap:

• Covers DP basics
• Memoization & Tabulation clearly
• Includes Fibonacci, Knapsack, LCS, LIS, MCM
• Covers DP on Trees & Graphs
• Perfect for college + placements + interviews
🧩 GREEDY ALGORITHMS PRACTICE
ROADMAP (TOPIC-WISE)

🔹 LEVEL 0: GREEDY STRATEGY (FOUNDATION)

Goal

Understand when greedy works.

Problems (1 → 6)

1. Explain greedy strategy with example


2. Identify greedy choice property
3. Identify optimal substructure
4. Compare greedy vs DP
5. When greedy fails (example)
6. Prove correctness of greedy solution

🔹 LEVEL 1: BASIC GREEDY PROBLEMS

Goal

Build greedy intuition.

Problems (7 → 15)

7. Coin change (greedy version)


8. Minimum number of coins
9. Maximum number of activities (simple)
10. Minimum platforms problem
11. Job sequencing with deadlines
12. Fractional knapsack
13. Minimum number of intervals to remove
14. Assign cookies problem
15. Gas station problem

🔹 LEVEL 2: ACTIVITY SELECTION PROBLEM


(IMPORTANT)

Goal

Classic greedy problem.

Problems (16 → 20)

16. Activity selection (recursive)


17. Activity selection (iterative)
18. Print selected activities
19. Maximum number of non-overlapping intervals
20. Activity selection with different start times

🔹 LEVEL 3: HUFFMAN ENCODING

Goal

Compression using greedy + heap.

Problems (21 → 26)

21. Explain Huffman coding


22. Build Huffman tree
23. Generate Huffman codes
24. Encode a string
25. Decode a string
26. Compare Huffman vs fixed-length encoding

🔹 LEVEL 4: MINIMUM SPANNING TREE (MST)

Goal

Greedy on graphs.

Problems (27 → 35)

27. Minimum spanning tree concept


28. Kruskal’s algorithm
29. Implement Disjoint Set (DSU)
30. Cycle detection using DSU
31. Prim’s algorithm (matrix)
32. Prim’s algorithm (priority queue)
33. Compare Prim vs Kruskal
34. Minimum cost to connect all points
35. MST for disconnected graph

🔹 LEVEL 5: INTERVAL & SCHEDULING GREEDY

Goal

Common interview pattern.

Problems (36 → 45)

36. Merge intervals


37. Insert interval
38. Minimum arrows to burst balloons
39. Non-overlapping intervals
40. Interval scheduling maximization
41. Meeting rooms I
42. Meeting rooms II
43. CPU task scheduling
44. Task scheduler with cooldown
45. Maximum events attended

🔹 LEVEL 6: ADVANCED GREEDY PROBLEMS

Goal

Placement-level mastery.

Problems (46 → 60)

46. Candy distribution


47. Jump game
48. Jump game II
49. Minimum number of refueling stops
50. Minimum deletions to make string balanced
51. Reorganize string
52. Remove K digits
53. Lexicographically smallest string
54. Partition labels
55. Boats to save people
56. Maximum units on a truck
57. Reduce array size to half
58. Minimize sum of absolute differences
59. Greedy with priority queue
60. Greedy vs DP decision problems

🔹 LEVEL 7: MIXED & PROOF-BASED GREEDY

Goal

Strong conceptual clarity.


Problems (61 → 70)

61. Prove correctness of activity selection


62. Prove correctness of Huffman coding
63. Prove correctness of Kruskal
64. Prove correctness of Prim
65. Counterexample for greedy failure
66. Greedy solution validation
67. Convert greedy to DP
68. Identify greedy pattern in problems
69. Real-world greedy applications
70. Revision & mixed greedy problems

✅ GREEDY ALGORITHMS TOTAL: 70


ORDERED PROBLEMS
This roadmap:

• Covers greedy strategy


• Includes activity selection
• Deeply covers Huffman encoding
• Covers MST (Prim & Kruskal)
• Is perfect for college + interviews
🧩 ADVANCED TOPICS PRACTICE
ROADMAP (TOPIC-WISE)

🔹 LEVEL 0: DIVIDE & CONQUER (FOUNDATION)

Goal

Break problem → solve subproblems → combine.

Problems (1 → 10)

1. Explain divide and conquer with example


2. Find maximum in array (D&C)
3. Find minimum in array (D&C)
4. Binary search (D&C view)
5. Merge sort (D&C breakdown)
6. Quick sort (D&C breakdown)
7. Find power using D&C
8. Count inversions
9. Maximum subarray (D&C)
10. Compare D&C vs DP

🔹 LEVEL 1: BIT MANIPULATION

Goal

Work with bits efficiently.

Problems (11 → 25)

11. Check if number is even/odd


12. Check if ith bit is set
13. Set ith bit
14. Clear ith bit
15. Toggle ith bit
16. Count set bits
17. Power of two check
18. Find single number
19. Find two non-repeating numbers
20. Find missing number
21. XOR of range
22. Swap numbers using XOR
23. Bit masking basics
24. Subsets using bitmask
25. Maximum AND pair

🔹 LEVEL 2: SLIDING WINDOW TECHNIQUE

Goal

Optimize subarray/substring problems.

Problems (26 → 40)

26. Maximum sum subarray of size K


27. First negative in every window
28. Count occurrences of anagram
29. Longest substring without repeating
30. Longest substring with K distinct
31. Minimum window substring
32. Maximum of all subarrays
33. Count subarrays with sum K
34. Longest subarray with sum K
35. Fruits into baskets
36. Sliding window on strings
37. Sliding window on arrays
38. Fixed vs variable window
39. Window shrinking problems
40. Sliding window revision

🔹 LEVEL 3: TWO POINTERS TECHNIQUE

Goal

Efficient traversal using two indices.

Problems (41 → 55)

41. Reverse array


42. Check palindrome string
43. Remove duplicates (sorted array)
44. Pair with given sum (sorted array)
45. 3-Sum problem
46. 4-Sum problem
47. Container with most water
48. Move zeros to end
49. Sort 0s,1s,2s (Dutch flag)
50. Trapping rainwater
51. Merge two sorted arrays
52. Squaring sorted array
53. Compare strings with backspace
54. Subsequence check
55. Two pointer vs sliding window

🔹 LEVEL 4: UNION-FIND / DISJOINT SET (DSU)

Goal

Efficient connectivity handling.


Problems (56 → 70)

56. Explain DSU with example


57. Implement union operation
58. Implement find operation
59. Path compression
60. Union by rank
61. Detect cycle using DSU
62. Kruskal using DSU
63. Number of connected components
64. Friend circle problem
65. Redundant connection
66. Accounts merge
67. Network connectivity
68. Dynamic connectivity
69. DSU vs DFS
70. DSU revision

🔹 LEVEL 5: ADVANCED GRAPH ALGORITHMS

Goal

Weighted graph mastery.

Problems (71 → 85)

71. Dijkstra’s algorithm


72. Dijkstra using priority queue
73. Bellman-Ford algorithm
74. Detect negative cycle
75. Floyd-Warshall algorithm
76. All-pairs shortest path
77. Compare shortest path algorithms
78. Prim’s algorithm
79. Kruskal’s algorithm
80. MST comparison
81. Network delay time
82. Cheapest flights
83. Shortest path in DAG
84. Path reconstruction
85. Advanced graph revision

🔹 LEVEL 6: STRING ALGORITHMS (IMPORTANT)

Goal

Fast string matching.

Problems (86 → 100)

86. Naive pattern matching


87. KMP algorithm
88. LPS array construction
89. Pattern search using KMP
90. Rabin-Karp algorithm
91. Rolling hash concept
92. Z-Algorithm
93. Pattern search using Z
94. Trie implementation
95. Insert in Trie
96. Search in Trie
97. Prefix matching
98. Auto-complete system
99. Longest common prefix (Trie)
100. String algorithms comparison
🔹 LEVEL 7: SEGMENT TREE & FENWICK TREE (BIT)

Goal

Fast range queries & updates.

Problems (101 → 115)

101. Segment tree concept


102. Build segment tree
103. Range sum query
104. Range minimum query
105. Point update
106. Lazy propagation
107. Segment tree for max query
108. Fenwick tree concept
109. Build Fenwick tree
110. Prefix sum using BIT
111. Range sum using BIT
112. Update BIT
113. Count inversions using BIT
114. Segment tree vs BIT
115. Real-time query system

✅ ADVANCED TOPICS TOTAL: 115


ORDERED PROBLEMS
This roadmap:

• Covers all advanced patterns


• Includes graphs, strings, DSU
• Handles range queries efficiently
• Makes you interview + competitive ready
🧠 IMPORTANT FOR INTERVIEWS – DSA
MASTER CHECKLIST

🔹 1. ARRAYS & STRINGS (🔥 HIGHEST PRIORITY)

Core Array Problems

1. Reverse an array
2. Find max & min
3. Second largest element
4. Rotate array by K
5. Move zeros to end
6. Kadane’s algorithm
7. Majority element
8. Two Sum
9. Three Sum
10. Subarray with sum K
11. Longest subarray with sum K
12. Stock buy & sell
13. Rainwater trapping
14. Container with most water
15. Merge intervals

Core String Problems

16. Reverse string


17. Palindrome check
18. Anagram check
19. First non-repeating character
20. Longest common prefix
21. Longest substring without repeat
22. Valid parentheses
23. String rotation
24. Group anagrams
25. Minimum window substring

Interview Expectation:
Time complexity explanation is mandatory.

🔹 2. LINKED LIST, STACK, QUEUE

Linked List (Very Common)

26. Reverse linked list


27. Detect loop (Floyd)
28. Find middle node
29. Nth node from end
30. Merge two sorted lists
31. Intersection of two lists
32. Palindrome linked list

Stack

33. Implement stack


34. Valid parentheses
35. Next greater element
36. Stock span problem
37. Min stack (O(1))
38. Infix → Postfix
39. Evaluate postfix

Queue

40. Implement queue


41. Circular queue
42. Sliding window maximum
43. First non-repeating character in stream
44. Queue using stack
45. Stack using queue

🔹 3. TREES & GRAPHS (🔥 VERY IMPORTANT)

Trees

46. Tree traversals (all 4)


47. Height of tree
48. Diameter of tree
49. Lowest common ancestor
50. Check balanced tree
51. Zigzag traversal
52. BST insert/search/delete
53. Kth smallest in BST
54. Heap (Kth largest)
55. Trie insert & search

Graphs

56. BFS
57. DFS
58. Detect cycle (directed & undirected)
59. Topological sort
60. Shortest path (Dijkstra)
61. Minimum spanning tree
62. Number of islands
63. Rotten oranges
64. Bipartite graph
🔹 4. RECURSION & DYNAMIC PROGRAMMING

Recursion

65. Factorial
66. Fibonacci
67. Subsets
68. Permutations
69. Tower of Hanoi
70. Rat in a maze
71. N-Queens

Dynamic Programming (🔥 MUST)

72. Fibonacci (DP)


73. Climbing stairs
74. 0/1 Knapsack
75. Subset sum
76. Longest common subsequence
77. Longest increasing subsequence
78. Coin change
79. Matrix chain multiplication
80. DP on grid

🔹 5. SORTING & SEARCHING

Searching

81. Linear search


82. Binary search
83. First & last occurrence
84. Search in rotated array
85. Binary search on answer
Sorting

86. Bubble / Selection / Insertion (concept)


87. Merge sort
88. Quick sort
89. Heap sort
90. Counting sort
91. Sort 0s, 1s, 2s
92. Kth smallest element

🔹 6. HASHING (🔥 FREQUENTLY ASKED)


93. Frequency counting
94. First non-repeating element
95. Two Sum (hash map)
96. Longest consecutive sequence
97. Subarray sum equals K
98. Group anagrams
99. Isomorphic strings
100. Top K frequent elements

🔹 7. PROBLEM-SOLVING PATTERNS (INTERVIEW GOLD


🥇)

Patterns you MUST recognize

101. Sliding window


102. Two pointers
103. Prefix sum
104. Hash map
105. Recursion → DP
106. Greedy choice
107. Binary search on answer
108. Backtracking
109. Divide & conquer
110. DSU (Union-Find)

You might also like