0% found this document useful (0 votes)
18 views

Essential_Coding_Questions_Basic_to_Advanced

The document lists essential coding questions categorized into three levels: Basic, Intermediate, and Advanced. Each category contains various programming challenges ranging from simple tasks like printing messages to complex algorithms involving data structures and graph theory. This comprehensive collection serves as a resource for practicing coding skills and preparing for technical interviews.

Uploaded by

emikadeimaya18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Essential_Coding_Questions_Basic_to_Advanced

The document lists essential coding questions categorized into three levels: Basic, Intermediate, and Advanced. Each category contains various programming challenges ranging from simple tasks like printing messages to complex algorithms involving data structures and graph theory. This comprehensive collection serves as a resource for practicing coding skills and preparing for technical interviews.

Uploaded by

emikadeimaya18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Essential Coding Questions: Basic to Advanced

Basic Questions

101. Print 'Hello, World!' to the console.

102. Add two numbers provided by the user.

103. Find the largest of three numbers.

104. Find the smallest of three numbers.

105. Check if a character is a vowel or consonant.

106. Print numbers from 1 to 100.

107. Print all even numbers from 1 to 100.

108. Print all odd numbers from 1 to 100.

109. Find the sum of the first n natural numbers.

110. Find the product of the first n natural numbers.

111. Calculate the power of a number (x^y).

112. Swap two numbers using a temporary variable.

113. Convert a temperature from Celsius to Fahrenheit.

114. Convert a temperature from Fahrenheit to Celsius.

115. Print the ASCII value of a character.

116. Calculate the area of a circle given its radius.

117. Calculate the area of a rectangle given its length and breadth.

118. Calculate the perimeter of a rectangle.

119. Check if a year is a leap year.

120. Find the sum of digits of a number.

Intermediate Questions

1. Reverse an array.
2. Find the maximum and minimum number in an array.

3. Generate the Fibonacci series up to n terms.

4. Check if a given string is a palindrome.

5. Find the factorial of a number.

6. Search for an element in an array (Linear Search).

7. Implement Binary Search.

8. Sort an array using Bubble Sort.

9. Sort an array using Quick Sort.

10. Sort an array using Merge Sort.

11. Implement Insertion Sort.

12. Find the GCD of two numbers.

13. Find the LCM of two numbers.

14. Count the number of vowels and consonants in a string.

15. Check if a number is prime.

16. Check if a number is even or odd.

17. Swap two numbers without using a third variable.

18. Find the second largest element in an array.

19. Find the second smallest element in an array.

20. Rotate an array to the left by k positions.

21. Rotate an array to the right by k positions.

22. Check if a number is an Armstrong number.

23. Check if a number is a perfect number.

24. Find the sum of all elements in an array.

25. Find the product of all elements in an array.

26. Find the length of a string without using built-in functions.

27. Reverse a string.

28. Remove duplicate elements from an array.


29. Find the intersection of two arrays.

30. Find the union of two arrays.

31. Count the frequency of each element in an array.

32. Find the missing number in an array of 1 to n.

33. Find the duplicate number in an array.

34. Merge two sorted arrays into one sorted array.

35. Implement a stack using arrays.

36. Implement a queue using arrays.

37. Convert a decimal number to binary.

38. Convert a binary number to decimal.

39. Check if two strings are anagrams.

40. Find the longest substring without repeating characters.

41. Find the longest common prefix among strings.

42. Implement a linked list.

43. Reverse a linked list.

44. Detect a cycle in a linked list.

45. Find the middle element of a linked list.

46. Find the nth node from the end in a linked list.

47. Implement a stack using linked lists.

48. Implement a queue using linked lists.

49. Implement binary tree traversal (Inorder, Preorder, Postorder).

50. Find the height of a binary tree.

Advanced Questions

51. Find the diameter of a binary tree.

52. Check if a binary tree is balanced.

53. Find the lowest common ancestor of two nodes in a binary tree.
54. Implement a binary search tree (BST).

55. Search for a value in a BST.

56. Find the minimum and maximum values in a BST.

57. Delete a node from a BST.

58. Check if a BST is valid.

59. Implement a graph using adjacency matrix.

60. Implement a graph using adjacency list.

61. Perform BFS traversal of a graph.

62. Perform DFS traversal of a graph.

63. Find the shortest path in a graph using Dijkstra's algorithm.

64. Find the shortest path in a graph using Bellman-Ford algorithm.

65. Implement Floyd-Warshall algorithm.

66. Implement Kruskal's algorithm for Minimum Spanning Tree.

67. Implement Prim's algorithm for Minimum Spanning Tree.

68. Check if a graph is bipartite.

69. Solve the N-Queens problem.

70. Solve the Tower of Hanoi problem.

71. Implement a hash table.

72. Find the first non-repeating character in a string.

73. Find the first repeating character in a string.

74. Find the kth largest element in an array.

75. Find the kth smallest element in an array.

76. Find all pairs in an array whose sum equals a given number.

77. Implement a sliding window algorithm.

78. Find the maximum sum subarray (Kadane's Algorithm).

79. Implement matrix multiplication.

80. Transpose a matrix.


81. Check if two matrices are equal.

82. Implement Depth First Search (DFS) on a matrix.

83. Implement Breadth First Search (BFS) on a matrix.

84. Find the number of islands in a grid.

85. Solve the Sudoku puzzle.

86. Implement a Trie data structure.

87. Find the longest palindrome substring.

88. Check if a string is a valid parenthesis expression.

89. Find all permutations of a string.

90. Find all subsets of a set.

91. Implement a priority queue.

92. Perform heap sort.

93. Find the median of two sorted arrays.

94. Implement dynamic programming to solve the knapsack problem.

95. Find the edit distance between two strings.

96. Solve the coin change problem using dynamic programming.

97. Implement LRU Cache.

98. Check if a number is a palindrome.

99. Generate Pascal's Triangle.

100. Count the number of set bits in a number.

101. Find the missing number in an array.

102. Check if a year is a leap year.

103. Check if a matrix is symmetric.

104. Find the determinant of a matrix.

105. Rotate a matrix 90 degrees clockwise.

106. Rotate a matrix 90 degrees counterclockwise.

107. Find the largest connected component in a grid.


108. Implement Bellman-Ford algorithm for negative weight edges.

109. Find the longest increasing subsequence in an array.

110. Solve the Rod Cutting problem using dynamic programming.

111. Solve the Word Break problem.

112. Find the maximum product subarray.

113. Solve the 0-1 Knapsack problem.

114. Implement a disjoint set union (DSU).

115. Check if a directed graph has a cycle.

116. Find the transpose of a directed graph.

117. Perform topological sort on a directed graph.

118. Find the number of strongly connected components in a graph.

119. Implement the Travelling Salesman Problem using dynamic programming.

120. Solve the Minimum Path Sum problem for a grid.

121. Implement a circular queue.

122. Find the majority element in an array.

123. Implement the Boyer-Moore Voting Algorithm.

124. Find the longest palindromic subsequence.

125. Solve the Longest Common Subsequence problem.

126. Solve the Partition Equal Subset Sum problem.

127. Count the number of distinct substrings of a string.

128. Implement the Rabin-Karp algorithm for string matching.

129. Implement the KMP algorithm for string matching.

130. Solve the Maximum Profit in Job Scheduling problem.

131. Find the largest rectangle in a histogram.

132. Solve the Gas Station problem.

133. Find the minimum number of coins to make change.

134. Solve the Interval Scheduling Maximization problem.


135. Find the longest path in a directed acyclic graph (DAG).

136. Check if a number is a power of two.

137. Count the total number of set bits in all integers from 1 to n.

138. Reverse a number without converting it to a string.

139. Count the number of digits in a number.

140. Print all prime factors of a number.

141. Generate all prime numbers up to n using the Sieve of Eratosthenes.

142. Find the sum of digits of a number.

143. Check if a number is a Harshad number.

144. Check if a string contains only digits.

145. Find the first missing positive integer in an array.

146. Find the longest consecutive sequence in an array.

147. Solve the Subset Sum problem using dynamic programming.

148. Find the length of the shortest path between two nodes in an unweighted graph.

149. Implement the A* search algorithm.

150. Find the minimum spanning tree using Prim's algorithm.

151. Solve the Maximum Flow problem using the Ford-Fulkerson algorithm.

152. Implement the Edmonds-Karp algorithm for Maximum Flow.

153. Check if a string is a rotation of another string.

154. Find the smallest window in a string containing all characters of another string.

155. Solve the Longest Palindromic Substring problem.

156. Find the longest repeating substring in a string.

157. Solve the Minimum Insertions to Make a String Palindrome problem.

158. Implement a circular linked list.

159. Check if a linked list is a palindrome.

160. Flatten a binary tree to a linked list.

161. Find the maximum width of a binary tree.


162. Serialize and deserialize a binary tree.

163. Find all paths from the root to a leaf in a binary tree.

164. Count the number of leaf nodes in a binary tree.

165. Solve the Minimum Cost to Connect Sticks problem.

166. Solve the Min Cost Climbing Stairs problem.

167. Find the maximum path sum in a binary tree.

168. Check if two binary trees are identical.

169. Check if a binary tree is a subtree of another binary tree.

170. Find the vertical order traversal of a binary tree.

171. Solve the Maximum Depth of a Binary Tree problem.

172. Find the number of ways to climb stairs with variable steps.

173. Solve the Maximum Area of Island problem in a grid.

174. Solve the House Robber problem using dynamic programming.

175. Solve the House Robber II problem with a circular array.

176. Find the minimum path sum in a triangle.

177. Solve the Range Sum Query problem using Fenwick Tree.

178. Find the number of subarrays with a given sum.

179. Implement the Sliding Window Maximum problem.

180. Solve the Subarray Product Less Than K problem.

181. Solve the Word Ladder problem using BFS.

182. Solve the Word Search problem in a grid.

183. Find the minimum number of jumps to reach the end of an array.

184. Solve the Unique Paths problem using dynamic programming.

185. Solve the Unique Paths II problem with obstacles.

186. Find the minimum cost path in a grid.

187. Solve the Paint House problem using dynamic programming.

188. Solve the Paint Fence problem using dynamic programming.


189. Solve the Min Cost to Cut a Stick problem using dynamic programming.

190. Solve the Longest Arithmetic Subsequence problem.

191. Find the length of the Longest Bitonic Subsequence.

192. Solve the Decode Ways problem using dynamic programming.

193. Solve the Count and Say problem.

194. Find the number of trailing zeros in a factorial.

195. Solve the Combination Sum problem.

196. Solve the Combination Sum II problem.

197. Find the kth missing positive integer.

198. Solve the Binary Search Tree Iterator problem.

199. Solve the Sliding Puzzle problem.

200. Solve the Sudoku Solver problem.

You might also like