Capegemini Consulting India Private Limited interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Capegemini Consulting India Private Limited
upvote
share-icon
4 rounds | 16 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, DBMS , OOPS, System Design, Algorithms, Dynamic Programming.
Tip
Tip

Tip 1 : Practice At least 250 Questions of coding
Tip 2 : Do at least 2 application based projects

Application process
Where: Campus
Eligibility: 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
Tip 3 : Project should clear.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date9 Oct 2019
Coding problem6

Online assessment consists of :-

Section 1: Pseudocode and coding round 
after this section there was english communication based assessment based on passages , jumbled words

section 2: game-based aptitude (not elimination round)

Section 3: Behaviour competency (not elimination round)

1. Number Of Pairs With Given Sum

Moderate
39m average time
60% success
0/80
Asked in companies
Goldman SachsAmazonSamsung

You have been given an integer array/list(arr) and a number 'Sum'. Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Note:
Given array/list can contain duplicate elements.

(arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
Problem approach

Follow the steps below to solve the given problem:

Initialize the count variable with 0 which stores the result.
Iterate arr and if the sum of ith and jth [i + 1…..n – 1] element is equal to sum i.e. arr[i] + arr[j] == sum, then increment the count variable.
Return the count.

Try solving now

2. Spiral Matrix

Easy
15m average time
80% success
0/40
Asked in companies
WalmartOracleApple

You are given a 2-D array 'MATRIX' of dimensions N x M, of integers. You need to return the spiral path of the matrix.

Example Of Spiral Path:

Spiral path of a matrix

Problem approach

Algorithm:
Let the array have R rows and C columns. seen[r] denotes that the cell on the r-th row and c-th column was previously visited. Our current position is (r, c), facing direction di, and we want to visit R x C total cells.
As we move through the matrix, our candidate’s next position is (cr, cc). If the candidate is in the bounds of the matrix and unseen, then it becomes our next position; otherwise, our next position is the one after performing a clockwise turn.

Try solving now

3. Subtree of Another Tree

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftFacebookAmazon

Given two binary trees T and S, check whether tree S has exactly the same structure and node values with a subtree of T, i.e., check if tree S is a subtree of the tree T.

A subtree of a tree T is a tree S consisting of a node in T and all of its descendants in T. The subtree corresponding to the root node is the entire tree; the subtree corresponding to any other node is called a proper subtree.

Problem approach

Traverse the tree T in preorder fashion. For every visited node in the traversal, see if the subtree rooted with this node is identical to S.

Try solving now

4. Output Question

What will be the output of the following code snippet?

#include int foo(int* a, int* b){    

int sum = *a + *b;    *b = *a;    

return *a = sum - *b;}

int main(){    int i = 0, j = 1, k = 2, l;   

 l = i++ || foo(&j, &k);    

printf("%d %d %d %d", i, j, k, l);    

return 0;}

Problem approach

Ans : 1 2 1 1

The control in the logical OR goes to the second expression only if the first expression results in FALSE. The function foo() is called because i++ returns 0(post-increment) after incrementing the value of i to 1. The foo() function actually swaps the values of two variables and returns the value of the second parameter. So, values of variables j and k get exchanged and OR expression evaluates to be TRUE.1 2 1 1

5. Technical Question

Consider the following C function

void swap ( int x, int y ){     int tmp;     tmp = x;     x = y;     y = tmp;}

In order to exchange the values of two variables a and b:a) 

Call swap (a, b)b) Call swap (&a, &b)c) swap(a, b) cannot be used as it does not return any valued) swap(a, b) cannot be used as the parameters passed by value

Problem approach

The code will not work because the parameters are passed by value. In order to swap the values of x and y the parameters should be passed with reference. The correct code is: D) 

void swap ( int &x, int &y )
{
int tmp;
tmp = x;
x = y;
y = tmp;
}

6. Technical Question

#includeint main(){for (int x = 10; x >= 0; x--) {int z = x & (x >> 1);if (z)printf("%d ", x);}}

Problem approach

7 6 3

Here, in the given code, >> is the bitwise right shift operator and x>>y => x/(2^y) and & is the bitwise and operator and gives 1 only if both bits are same. Now, for x = 10, (10>=0) z = 10 & (10>>1) => z = 10 & 5 => z=10. Similarly for x= 9, 8, 5, 4, 2, 1 and 0 , z will be zero and for x=7, z will be 3 , for x= 6, z will be 2 and for x=3, z will be 1 for x=7, 6, and 3 z is non zero so the will get printed on the output screen. Hence, we get output as 7 6 3

02
Round
Easy
Video Call
Duration45 minutes
Interview date9 Oct 2019
Coding problem2

In this round we were made to play around 3-4 aptitude games.

1. Puzzle

Digit Game :-

Problem Statement: You’re giving a mathematical statement and you need to create a correct combination of digits, to make LHS = RHS. Note : One Digit may only be used once, in some cases the all the digits may not be available

2. Puzzle

Deductive Logical Thinking (Geo-Sudo Challenge)

You’re given a 4×4 or 5×5 or 6×6 grid. You’re supposed to find the missing value based on some rules

Decoding Rules

One geometrical shape can only occur once, in any row or any column

03
Round
Medium
Video Call
Duration35 minutes
Interview date14 Oct 2019
Coding problem7

Technical round -1 . Questions were asked from Resume and Coding problem were given to solve

1. Maximum length pair chain

Moderate
15m average time
85% success
0/80
Asked in companies
UberMicrosoftAmazon

You are given ‘N’ pairs of integers in which the first number is always smaller than the second number i.e in pair (a,b) -> a < b always. Now we define a pair chain as the continuous arrangement of pairs in which a pair (c,d) can follow another pair (a,b) only when b < c.

Find the length of the longest pair chain that can be formed using the given pairs.

Example:
Given Pairs =  [3,4], [1,2], [2,3].

The length of the maximum chain will be 2. The longest chain is [1,2] -> [3,4].
Note:
1. You can select a pair only once.

2. You needn’t use up all the given pairs.

3. You can select pairs in any order. 
Try solving now

2. Sum of Two Elements Equals the Third.

Easy
10m average time
90% success
0/40
Asked in companies
HSBCBarclaysJio Platforms Limited

You are given an array Arr consisting of n integers, you need to find a valid triplet as explained below.

An array is said to have a valid triplet {arr[i], arr[j], arr[k]} if there exists three indices i, j and k such that i != j, j != k and i != j and arr[i] + arr[j] = arr[k] or arr[i] + arr[k] = arr[j] or arr[k] + arr[j] = arr[i].

For Example:
Arr = 10, 5, 5, 6, 2, 
In this array, the triplet {10, 5, 5} is valid triplet because, 5 + 5 = 10.

Note:

The elements in the array need not be distinct.
Problem approach

Sort the given array first.
Start fixing the greatest element of three from the back and traverse the array to find the other two numbers which sum up to the third element.
Take two pointers j(from front) and k(initially i-1) to find the smallest of the two number and from i-1 to find the largest of the two remaining numbers
If the addition of both the numbers is still less than A[i], then we need to increase the value of the summation of two numbers, thereby increasing the j pointer, so as to increase the value of A[j] + A[k].
If the addition of both the numbers is more than A[i], then we need to decrease the value of the summation of two numbers, thereby decrease the k pointer so as to decrease the overall value of A[j] + A[k].

Try solving now

3. Java Question

What do you know about java frameworks?

4. Java Question

What is Java Spring Boot

Problem approach

Java Spring Boot (Spring Boot) is a tool that makes developing web application and microservices with Spring Framework faster and easier through three core capabilities:

5. OS Question

What is Race round condition?

6. SQL Question

Write a Sql querry to differentiate Joins.

7. What is Data encapsulation?

What is Garbage collector in JAVA?

What is encapsulation?

Problem approach

Data encapsulation, also known as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user.

04
Round
Easy
HR Round
Duration30 minutes
Interview date17 Oct 2019
Coding problem1

1. Basic HR Questions

why you want to join Capgemini

Tell me 2 reasons why we should Hire you

In which technology you want to get your profile in Capgemini

Will u go for Masters??

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
SDE - 1
2 rounds | 6 problems
Interviewed by Capegemini Consulting India Private Limited
0 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Capegemini Consulting India Private Limited
400 views
0 comments
0 upvotes
SDE - 1
3 rounds | 13 problems
Interviewed by Capegemini Consulting India Private Limited
484 views
0 comments
0 upvotes
SDE - 1
2 rounds | 3 problems
Interviewed by Capegemini Consulting India Private Limited
472 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes