0% found this document useful (0 votes)
263 views3 pages

0.1 Top 100 Dsa Interview Questions

The document is a comprehensive list of algorithmic problems and challenges categorized into various topics such as Arrays, Strings, Linked Lists, Trees, Graphs, and more. It includes specific tasks like finding missing numbers, reversing strings, implementing data structures, and solving dynamic programming problems. Each category contains numerous problems aimed at enhancing coding and problem-solving skills.

Uploaded by

bedorat563
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)
263 views3 pages

0.1 Top 100 Dsa Interview Questions

The document is a comprehensive list of algorithmic problems and challenges categorized into various topics such as Arrays, Strings, Linked Lists, Trees, Graphs, and more. It includes specific tasks like finding missing numbers, reversing strings, implementing data structures, and solving dynamic programming problems. Each category contains numerous problems aimed at enhancing coding and problem-solving skills.

Uploaded by

bedorat563
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
You are on page 1/ 3

### Array 57. Flatten a multilevel linked list.

1. Find the missing number in a given integer array of 1 to 58. Remove nodes from a linked list that have a greater value
100. on the right.
2. Find the duplicate number on a given integer array. 59. Clone a linked list with next and random pointer.
3. Find the largest and smallest number in an unsorted 60. Implement a skip list.
integer array.
4. Find all pairs of an integer array whose sum is equal to a ### Stack and Queue
given number. 61. Implement a stack using an array/linked list.
5. Find duplicate numbers in an array containing multiple 62. Implement a queue using an array/linked list.
duplicates. 63. Implement a stack using two queues.
6. Remove duplicates from an array in place. 64. Implement a queue using two stacks.
7. Reverse an array in place. 65. Sort a stack.
8. Find the intersection of two arrays. 66. Evaluate a postfix expression using a stack.
9. Find the maximum product of two integers in an array. 67. Implement a priority queue.
10. Find the minimum value in a rotated sorted array. 68. Check for balanced parentheses in an expression.
11. Find the maximum sum subarray (Kadane’s algorithm). 69. Find the maximum element in a stack in O(1) time.
12. Rotate an array by k positions. 70. Implement a circular queue.
13. Find the subarray with the given sum. 71. Design a stack that supports getMin() in O(1) time.
14. Merge two sorted arrays. 72. Implement efficient k stacks in a single array.
15. Move all zeros to the end of an array. 73. Implement an LFU cache.
16. Find the majority element in an array using the 74. Generate binary numbers from 1 to n using a queue.
Boyer-Moore voting algorithm. 75. Reverse the first k elements of a queue.
17. Find the equilibrium index of an array. 76. Check if all the leaves are at the same level in a binary
18. Rearrange an array such that even index elements are tree using a queue.
smaller and odd index elements are greater. 77. Implement a monotonic queue.
19. Find the largest subarray with equal number of 0s and 1s. 78. Check for redundancy in an arithmetic expression.
20. Find the smallest subarray with a sum greater than a 79. Design a stack that supports push, pop, top, and
given value. retrieving the maximum element in O(1) time.
80. Implement a deque using a doubly linked list.
### Strings
21. Reverse a string in place. ### Tree
22. Check if two strings are anagrams of each other. 81. Traverse a binary tree in preorder, inorder, and postorder.
23. Find all permutations of a string. 82. Implement a binary search tree (BST).
24. Find the first non-repeating character in a string. 83. Find the height of a binary tree.
25. Count the occurrence of a given character in a string. 84. Find the lowest common ancestor (LCA) of two nodes in a
26. Remove duplicate characters from a string. binary tree.
27. Check if a string is a palindrome. 85. Check if a binary tree is balanced.
28. Convert a given string into an integer. 86. Check if two binary trees are identical.
29. Find the longest substring without repeating characters. 87. Find the maximum depth of a binary tree.
30. Find the longest common prefix. 88. Find the diameter of a binary tree.
31. Convert a given string into its integer equivalent (atoi). 89. Convert a binary tree to a doubly linked list.
32. Check if a string is a valid shuffle of two distinct strings. 90. Print all nodes at a distance k from a given node in a
33. Implement strstr() function to find the first occurrence of a binary tree.
substring. 91. Convert a binary search tree to a balanced binary search
34. Find the longest repeating subsequence in a string. tree.
35. Remove all adjacent duplicates in a string. 92. Print the nodes of a binary tree in a vertical order.
36. Check if one string is a rotation of another. 93. Find the level of a node in a binary tree.
37. Find the smallest window in a string containing all 94. Connect nodes at the same level in a binary tree.
characters of another string. 95. Construct a binary tree from its preorder and inorder
38. Find the longest palindromic substring. traversal.
39. Convert a string to title case (first letter of each word in 96. Construct a binary tree from its inorder and postorder
uppercase). traversal.
40. Count and say the sequence for a given number. 97. Serialize and deserialize a binary tree.
98. Find the inorder successor in a binary search tree.
### Linked List 99. Check if a binary tree is a subtree of another binary tree.
41. Reverse a linked list. 100. Find the sum of all left leaves in a binary tree.
42. Detect a cycle in a linked list.
43. Find the middle element of a linked list. ### Graph
44. Remove the nth node from the end of a linked list. 101. Implement depth-first search (DFS) and breadth-first
45. Merge two sorted linked lists. search (BFS).
46. Remove duplicates from a linked list. 102. Find the shortest path in an unweighted graph.
47. Find the intersection point of two linked lists. 103. Detect a cycle in a directed/undirected graph.
48. Detect and remove a loop in a linked list. 104. Find strongly connected components in a graph.
49. Add two numbers represented by linked lists. 105. Implement Dijkstra’s algorithm.
50. Check if a linked list is a palindrome. 106. Implement Prim’s algorithm.
51. Implement a singly linked list. 107. Implement Kruskal’s algorithm.
52. Implement a doubly linked list. 108. Find the shortest path in a weighted graph.
53. Delete a node in a singly linked list given only access to 109. Check if a graph is bipartite.
that node. 110. Find the number of islands in a given 2D matrix.
54. Find the intersection point of two linked lists using two 111. Implement the Floyd-Warshall algorithm.
pointers. 112. Detect a negative cycle in a graph.
55. Split a linked list into two equal halves. 113. Find articulation points in a graph.
56. Sort a linked list using merge sort. 114. Find bridges in a graph.
115. Find the mother vertex in a graph. 174. Implement a Red-Black Tree.
116. Topologically sort a graph. 175. Implement an AVL Tree.
117. Implement the Bellman-Ford algorithm. 176. Find the maximum flow in a flow network using the
118. Implement the A* search algorithm. Ford-Fulkerson algorithm.
119. Find the transitive closure of a graph. 177. Implement the Rabin-Karp algorithm for substring
120. Implement Kahn’s algorithm for topological sorting. search.
178. Implement the KMP algorithm for pattern matching.
### Sorting and Searching 179. Solve the Traveling Salesman Problem using dynamic
121. Implement quicksort. programming.
122. Implement mergesort. 180. Solve the Graph Coloring problem.
123. Implement heapsort.
124. Implement binary search. ### System Design
125. Find the kth largest element in an unsorted array. 181. Design a URL shortening service.
126. Search for a given number in a rotated sorted array. 182. Design a cache system.
127. Count the number of occurrences of a given number in a 183. Design a messaging queue.
sorted array. 184. Design a file storage system like Dropbox or Google
128. Search for a range in a sorted array. Drive.
129. Sort an array with many duplicated values. 185. Design a search autocomplete system.
130. Find the median of two sorted arrays. 186. Design a rate limiter.
131. Find the kth smallest element in a binary search tree. 187. Design a parking lot system.
132. Sort an array using heapsort. 188. Design a ride-sharing service like Uber or Lyft.
133. Sort a nearly sorted (or K sorted) array. 189. Design a social media feed system.
134. Find the fixed point in a given array. 190. Design a hotel reservation system.
135. Perform an exponential search.
136. Implement the interpolation search.
137. Search in a row-wise and column-wise sorted matrix.
138. Count inversions in an array. ### Algorithm Analysis and Complexity
139. Find the peak element in an array. 191. Analyze the time and space complexity of an algorithm.
140. Find the frequency of an element in a sorted array. 192. Determine the Big-O notation of an algorithm.
193. Compare the time complexity of different algorithms.
### Dynamic Programming 194. Optimize an algorithm for better performance.
141. Implement the Fibonacci sequence using dynamic 195. Identify bottlenecks in an algorithm.
programming. 196. Prove the correctness of an algorithm.
142. Solve the Knapsack problem. 197. Find the amortized time complexity of a data structure
143. Solve the Longest Common Subsequence problem. operation.
144. Solve the Longest Increasing Subsequence problem. 198. Analyze the performance of recursive algorithms.
145. Solve the Edit Distance problem. 199. Use dynamic programming to optimize a recursive
146. Solve the Coin Change problem. solution.
147. Solve the Maximum Subarray problem. 200. Solve problems using divide and conquer strategies.
148. Solve the Egg Dropping problem.
149. Solve the 0/1 Knapsack problem. ### Miscellaneous
150. Solve the Minimum Path Sum problem. 201. Design a vending machine.
151. Solve the Rod Cutting problem. 202. Design an elevator system.
152. Solve the Longest Bitonic Subsequence problem. 203. Design a library management system.
153. Solve the Matrix Chain Multiplication problem. 204. Design a hospital management system.
154. Solve the Subset Sum problem. 205. Design a movie ticket booking system.
155. Solve the Count of Subsets with a Given Sum problem. 206. Design an online food ordering system.
156. Solve the Target Sum problem. 207. Design a document editor like Google Docs.
157. Solve the Minimum Number of Insertions to Form a 208. Design a photo-sharing application like Instagram.
Palindrome problem. 209. Design a web crawler.
158. Solve the Maximum Product Subarray problem. 210. Design an email service like Gmail.
159. Solve the Maximum Length of Pair Chain problem. 211. Implement a least recently used (LRU) cache.
160. Solve the Word Break problem. 212. Implement a most recently used (MRU) cache.
213. Implement a random access data structure.
### Hashing 214. Design a logging system.
161. Implement a hash table. 215. Implement a thread-safe bounded blocking queue.
162. Design a hash map. 216. Design a file compression system.
163. Check if two strings are anagrams using a hash table. 217. Design a voting system.
164. Find the first non-repeating character using a hash map. 218. Design a fraud detection system.
165. Find the longest substring with distinct characters using 219. Design a recommendation system.
a hash map. 220. Design a blockchain.
166. Count the frequency of elements in an array using a
hash map. ### Coding Challenges
167. Group anagrams using a hash table. 221. Solve the Two Sum problem.
168. Check for pair sum in an array using hashing. 222. Solve the Add Two Numbers problem.
169. Find the largest subarray with 0 sum using a hash map. 223. Solve the Longest Substring Without Repeating
170. Find the longest consecutive subsequence using a hash Characters problem.
set. 224. Solve the Median of Two Sorted Arrays problem.
225. Solve the Longest Palindromic Substring problem.
### Advanced Topics 226. Solve the Container With Most Water problem.
171. Implement a Trie (Prefix Tree). 227. Solve the Trapping Rain Water problem.
172. Find the shortest path in a maze. 228. Solve the Multiply Strings problem.
173. Solve the N-Queens problem. 229. Solve the Permutations problem.
230. Solve the Rotate Image problem.
231. Solve the Group Anagrams problem.
232. Solve the Maximum Subarray problem.
233. Solve the Spiral Matrix problem.
234. Solve the Jump Game problem.
235. Solve the Merge Intervals problem.
236. Solve the Insert Interval problem.
237. Solve the Subsets problem.
238. Solve the Word Search problem.
239. Solve the Binary Tree Inorder Traversal problem.
240. Solve the Validate Binary Search Tree problem.
241. Solve the Symmetric Tree problem.
242. Solve the Binary Tree Level Order Traversal problem.
243. Solve the Convert Sorted Array to Binary Search Tree
problem.
244. Solve the Minimum Depth of Binary Tree problem.
245. Solve the Path Sum problem.
246. Solve the Construct Binary Tree from Preorder and
Inorder Traversal problem.
247. Solve the Binary Tree Maximum Path Sum problem.
248. Solve the Longest Consecutive Sequence problem.
249. Solve the Single Number problem.
250. Solve the Linked List Cycle problem.
251. Solve the Reorder List problem.
252. Solve the Maximum Product Subarray problem.
253. Solve the Find Minimum in Rotated Sorted Array
problem.
254. Solve the Search in Rotated Sorted Array problem.
255. Solve the Find Peak Element problem.
256. Solve the Word Ladder problem.
257. Solve the Clone Graph problem.
258. Solve the Course Schedule problem.
259. Solve the Implement Trie (Prefix Tree) problem.
260. Solve the Word Search II problem.
261. Solve the Maximal Rectangle problem.
262. Solve the Palindrome Partitioning problem.
263. Solve the Surrounded Regions problem.
264. Solve the Number of Islands problem.
265. Solve the Best Time to Buy and Sell Stock problem.
266. Solve the Best Time to Buy and Sell Stock II problem.
267. Solve the Best Time to Buy and Sell Stock III problem.
268. Solve the Single Number II problem.
269. Solve the Maximum Gap problem.
270. Solve the Factorial Trailing Zeroes problem.
271. Solve the Majority Element problem.
272. Solve the Excel Sheet Column Number problem.
273. Solve the Factorial Trailing Zeroes problem.
274. Solve the Rotate Array problem.
275. Solve the Binary Tree Right Side View problem.
276. Solve the Largest Number problem.
277. Solve the Basic Calculator problem.
278. Solve the Range Sum Query - Immutable problem.
279. Solve the Contains Duplicate problem.
280. Solve the Summary Ranges problem.
281. Solve the House Robber problem.
282. Solve the Implement Stack using Queues problem.
283. Solve the Implement Queue using Stacks problem.
284. Solve the Number of Digit One problem.
285. Solve the Count Primes problem.
286. Solve the Find the Duplicate Number problem.
287. Solve the Ugly Number problem.
288. Solve the Missing Number problem.
289. Solve the Product of Array Except Self problem.
290. Solve the Sliding Window Maximum problem.
291. Solve the Kth Largest Element in an Array problem.
292. Solve the Coin Change problem.
293. Solve the Combination Sum problem.
294. Solve the Permutation Sequence problem.
295. Solve the Remove Nth Node From End of List problem.
296. Solve the Longest Increasing Subsequence problem.
297. Solve the Reconstruct Itinerary problem.

You might also like