Here are 200 important coding questions that are commonly asked in Capgemini
Here are 200 important coding questions that are commonly asked in Capgemini
exams, based on previous years' patterns. These questions cover a wide range of topics, including
data structures, algorithms, problem-solving, dynamic programming, and object-oriented
programming.
Array Problems
2. Reverse an array.
10. Find all pairs in an array whose sum is equal to a given number.
15. Rearrange an array such that the positive and negative numbers are placed alternately.
String Problems
31. Find the smallest window in a string containing all characters of another string.
45. Delete the Nth node from the end of a linked list.
Tree Problems
61. Implement a function for in-order, pre-order, and post-order traversal of a binary tree.
64. Find the lowest common ancestor of two nodes in a binary tree.
80. Find the sum of all nodes at a given level in a binary tree.
Graph Problems
81. Implement Depth First Search (DFS) and Breadth First Search (BFS).
87. Implement Dijkstra's Algorithm for finding the shortest path in a weighted graph.
88. Find the minimum spanning tree of a graph using Kruskal's Algorithm.
89. Find the minimum spanning tree of a graph using Prim's Algorithm.
90. Implement the Bellman-Ford Algorithm for finding the shortest path.
96. Implement the Floyd-Warshall Algorithm for all pairs shortest path.
100. Implement the Kosaraju Algorithm for finding strongly connected components.
102. Find the minimum number of coins needed to make a given amount.
113. Find the maximum profit from stock prices with at most two transactions.
118. Find the minimum cost to reach the last cell of a matrix.
126. Implement a Min Stack that returns the minimum element in O(1) time.
128. Find the next greater element for every element in an array.
Mathematical Problems
143. Implement a function to find all prime numbers up to n using the Sieve of
Eratosthenes.
144. Find the factorial of a number using recursion.
161. Find the single number in an array where every other number appears twice.
163. Find the two non-repeating elements in an array where every other element repeats.
164. Find the missing number in an array of integers from 1 to n using XOR.
170. Find the next higher number with the same number of 1 bits in binary
representation.
196. Find the first and last position of a target element in a sorted array.
197. Check if an array can be divided into two subsets with equal sum.
200. Find the smallest range that includes at least one number from each of the k lists.