JUSPAY
10+ Capgemini Interview Questions and Answers
Q1. Dijkstra's Shortest Path Problem Statement
You are given an undirected graph with V
vertices (numbered from 0 to V-1) and E
edges. Each edge connects two nodes u
and v
and has an associated weight representing ...read more
The question is about finding the shortest path distance from a source node to all vertices in an undirected graph.
The graph is represented by the number of vertices and edges, followed by the edges and their distances.
The task is to find the shortest path distance from the source node (0) to all other nodes.
If a node is disconnected from the source node, print the maximum positive integer value (2147483647).
Implement the function and return the shortest path distances in asc...read more
Q2. Largest Cycle in Maze Problem Statement
Given a maze represented by 'N' cells numbered from 0 to N-1, and an array arr
of 'N' integers where arr[i]
denotes the cell number that can be reached from the 'i'-th ce...read more
Q3. Encode N-ary Tree to Binary Tree Problem Statement
You are provided with an N-ary tree constituted of 'N' nodes, where node '1' is the head of the tree. Your task is to encode this N-ary tree into a binary tree...read more
The task is to encode an N-ary tree into a binary tree and then decode the binary tree back into the original N-ary tree.
Encode the N-ary tree by representing each node as a binary tree node with its first child as the left child and subsequent children as the right child.
To decode the binary tree, traverse the binary tree and for each node, create a new N-ary tree node with its left child as the first child and subsequent right children as siblings.
Use a level order traversa...read more
Q4. Path Existence in Directed Graph
Given a directed and unweighted graph characterized by vertices 'V' and edges 'E', determine if a path exists from a specified 'source' vertex to a 'destination' vertex. The edg...read more
The task is to check if there exists a path from a given source vertex to a destination vertex in a directed and unweighted graph.
Read the number of test cases.
For each test case, read the number of vertices and edges.
Read the edges of the graph.
Read the source and destination vertices.
Implement a graph traversal algorithm (e.g., BFS or DFS) to check if a path exists from the source to the destination.
Print 'true' if a path exists, otherwise print 'false'.
Q5. Rat in a Maze Problem Statement
You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more
Q6. Ninja and the Maze Problem Statement
Ninja is stuck in a maze represented as a 2D grid. He can move in four directions (Up, Down, Left, Right) until he hits a wall ('1'). Once stopped, he can choose a new direc...read more
Q7. Develop two features to help Paytm cope up with loosing users?
Implement personalized recommendations and loyalty rewards program.
Implement personalized recommendations based on user behavior and preferences to increase user engagement.
Introduce a loyalty rewards program to incentivize users to continue using Paytm and earn rewards for their transactions.
Q8. Estimate the number of UPI transactions per day in Mumbai?
It is difficult to provide an accurate estimate without specific data, but the number of UPI transactions in Mumbai is likely to be high due to the city's large population and high digital adoption rate.
Mumbai is one of the largest cities in India with a high population density, leading to a high volume of transactions.
UPI (Unified Payments Interface) has gained significant popularity in India as a convenient and secure payment method.
Factors such as the number of smartphone ...read more
Q9. Favorite UPI App, and why?
My favorite UPI app is PhonePe because of its user-friendly interface and wide range of services.
User-friendly interface makes transactions quick and easy
Wide range of services like bill payments, recharges, and shopping
Offers cashback and rewards for transactions
Secure and reliable platform for financial transactions
Q10. how unordered set is implemented?
Unordered set is typically implemented using hash tables.
Uses hash tables to store elements with unique keys
Provides constant time complexity for insertion, deletion, and lookup operations
Does not maintain any specific order of elements
Q11. Optimisation of Part-A Solution
Optimizing Part-A solution involves identifying bottlenecks and improving efficiency.
Identify the most time-consuming parts of Part-A solution
Analyze the algorithms and data structures used for optimization
Consider parallel processing or distributed computing for faster execution
Optimize database queries and reduce unnecessary operations
Use caching mechanisms to store frequently accessed data
Q12. SQL query for specific case
SQL query to retrieve specific data based on a condition
Use SELECT statement to specify the columns to retrieve
Use WHERE clause to specify the condition for filtering the data
Use JOIN clause to combine data from multiple tables if needed
Q13. how set is implemented?
A set is implemented as a data structure that stores unique elements with no specific order.
A set does not allow duplicate elements.
Sets are commonly implemented using hash tables or binary search trees.
Examples of set implementations include HashSet in Java and std::set in C++.
Q14. 5 coins problem
The 5 coins problem involves finding the minimum number of weighings needed to identify a counterfeit coin among 5 identical coins.
Divide the coins into 3 groups of 2, 2, and 1 coin(s).
Weigh the 2 groups of 2 coins against each other.
If the 2 groups weigh the same, the counterfeit coin is in the group of 1 coin.
If one group is heavier, the counterfeit coin is in that group.
Weigh the 2 coins in the heavier group to find the counterfeit coin.
More about working at JUSPAY
Interview Process at Capgemini
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month