Hi friends, today in this post we’ll see the Capgemini Coding Questions as well as the Capgemini Coding Questions with Answers. If you want to land your dream job in the Capgemini but you don’t know where to get started, then you’re at the right place. Here we’ll provide you with the exact Capgemini Coding Questions so that you can prepare well for your upcoming exam conducted by Capgemini. But before getting started we’ll let you know some information about Capgemini.
Table of Contents
What is Capgemini?
Capgemini is a French multinational Information Technology service provider as well as a software consulting company. Its headquarters are situated in the capital of France i.e Paris. Capgemini was founded by Serge Kampf in the year 1967. It is among the top 10 MNC companies in India in terms of IT service providers and campus recruitments. Every year Capgemini hires more freshers as well as experienced software developers. Nearly 2 lakh+ employees are currently working in Capgemini still they’re hiring more and more employees each year.
Each year the Capgemini hires employees by conducting on campus as well as off-campus. They organized 12-week college hiring programs which are especially for BSc graduates as well as entry-level graduates.
Capgemini DCs are situated in the various parts of our country, therefore, the recruitments are done across pan India. So in this post, we’re going to see how the Capgemini recruitment process is done and what is the actual exam pattern.
Capgemini Coding Questions
From this year Capgemini has added this new round in their existing section process for graduates. The CoCubes platform will be used to conduct exams online. There will be a total of 3 coding questions which you’ve to solve within a time period of 75 minutes i.e 1.15 hours.
The main reason for adding this additional round in the section process is to check the candidate’s problem-solving skills. If you want to land your dream job in Capgemini then you’ve practiced more and more coding questions. We’ve added some practice coding questions in this post. If you solve these coding questions then you might be able to solve questions in the upcoming exams.
Details of Capgemini Coding Round
Coding Round | Details |
---|---|
No of Questions Asked | 3 |
Time | 75 Minutes |
Package Offered | 7.5 LPA |
Difficulty Level | High |
Basically, this round is conducted for those who are applying for special posts such as Analyst, etc. Their package is greater than the graduates which are hired by normal hirings. As shown in the table, the package offered for these employees is 7.5 LPA.
As this is the special post in Capgemini and the package offered is also higher than the normal, So the difficulty level of this round is also difficult.
Total 3 questions are asked and you’ve to solve them in 75 minutes so prepare well.
Now let’s solve some practice questions.
Practice Capgemini Coding Questions And Answers
1st Question
problem Statement: Write a function that will accept a string whose length is “len”, the string has some “#” keywords in it. Now move all the hashes ‘#’ to the front of the string and return the whole string back and last print it.
Sample Test Case:
Input: The#Learn#Programo
Output: ###TheLearnProgramo
Program in C++:
//Learnprogramo - programming made simple #include<bits/stdc++.h> using namespace std; char *moveHash(char str[], int len) { //Initilizing the required variables char result[100], resultHash[100]; int j=0, k=0, i; //Iterate on string for(i=0; i<len; i++) { //If hash found then adding # keyword in resultHash string and continue the loop if(str[i] == '#') { resultHash[k] = '#'; k++; continue; }//if.. //Here means not '#' char so adding original in result result[j] = str[i]; j++; }//for... //Print cout<<resultHash<<result; } int main() { //Initilizing the required variables char str[100]; int len; //Input cin>>str; //Calculating length of string len = strlen(str); moveHash(str, len); }
Output:
2nd Question
Problem Statement: The string contains multiple characters that are repeated consecutively. Now, write a program that will reduce the size of the string using the given mathematical logic.
Sample Test Case:
Input: abbcccddddeeeee
Output: a1b2c3d4e5
Program in C:
//Learnprogramo - programming made simple #include<stdio.h> int main() { char str[100]; scanf("%[^\n]s",str); int k=0, i, j, count = 0; char str1[100]; for(i = 0; str[i] != '\0'; i++) { count = 0; for(j = 0; j <= i; j++) { if(str[i] == str[j]) { count++; }//if.. }//for... if(count==1) { str1[k] = str[i]; k++; }//if.. }//for.. for(i=0; i<k; i++) { count = 0; for(j=0; str[j]!='\0'; j++) { if(str1[i]==str[j]) { count++; }//if.. }//for.. if(count==1) { printf("%c",str1[i]); }//if.. else { printf("%c%d",str1[i],count); }//else.. }//for.. return 0; }
Output:
3rd Question
Problem Statement: You will be given an array and you’ve to print the number of times that elements occur in the given array.
Sample Test Case:
Input:
10
1 3 4 2 1 2 2 1 4 3
Output:
1 occurs 3 times
2 occurs 3 times
3 occurs 2 times
4 occurs 2 times
Program in C++:
//Learnprogramo - programming made simple #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int arr[n]; //Getting array as an input for(int i=0; i<n; i++) { cin>>arr[i]; } //for.. //uniqueArr contains all unique elements in arr //k is the array index of uniqueArr int uniqueArr[n], countArr[n],k=0; for(int i=0; i<n; i++) { bool isElementInUniqueArr = false; for(int j=0; j<k; j++) { //Check the array element is present in unique array if( arr[i] == uniqueArr[j]) { //Increase the count of that element countArr[j]++; isElementInUniqueArr = true; } } if (isElementInUniqueArr == false) { //adding element in unique array uniqueArr[k] = arr[i]; //adding initial count of that element in count array countArr[k] = 1; //increase the pointer k++; } } for(int i=0; i<k; i++) { cout<<uniqueArr[i]<<" occurs "<<countArr[i]<<" times"<<endl; } return 0; }
Output:
4th Question
Problem Statement: Write a program that can traverse a matrix in a spiral format.
Sample Test Case:
Input:
3 3
1 2 3
4 5 6
7 8 9
Output: 1 2 3 6 9 8 7 4 5
Program in C:
//Learnprogramo - programming made simple #include<stdio.h> int main() { //Taking input for dimension of matrix int re, ce; scanf("%d",&re); scanf("%d",&ce); int i, j, k=0; //Taking matrix input int a[re][ce]; for(i=0;i<re;i++) { for(j=0;j<ce;j++) { scanf("%d",&a[i][j]); } } int rs = 0, cs = 0; //Iterate the loop to the each element in matrix while(rs<re && cs<ce) { //Iterate the loop on matrix column for(i=cs;i<ce;i++) { printf("%d\t",a[rs][i]); } //Increase the row index rs++; //Iterate the loop on matrix row for(i=rs;i<re;i++) { printf("%d\t",a[i][ce-1]); } //Decrease the column index ce--; if(rs<re) { for(i=ce-1; i>=cs; --i) { printf("%d\t", a[re - 1][i]); } re--; } if(cs<ce) { for(i=re-1; i>=rs; --i) { printf("%d\t", a[i][cs]); } cs++; } } return 0; }
Output:
5th Question
Problem Statement: There are multiple dealerships for cars and bikes. Now, write a program that will calculate how many types are in each and every dealership.
Sample Test Case:
Input:
3
2 4
5 0
1 2
Output:
16 20 8
Program in C++:
//Learnprogramo - programming made simple #include <iostream> using namespace std; int main() { // Initialization int totalDealerships; //Input cin>>totalDealerships; // Initialization int cars[totalDealerships], bikes[totalDealerships]; //Taking input for(int i=0;i<totalDealerships;i++) { cin>>cars[i]>>bikes[i]; }//for.. //Calculating total number of tyres in each dealerships for(int i=0;i<totalDealerships;i++) { //Printing output cout<<(cars[i]*4) + (bikes[i]*2) <<endl; }//for.. }
Output:
Explanation:
Here, is the total no of dealerships: 3. The Dealership contains 2 cars and 4 bikes, Dealership B contains 5 cars and 0 bikes and Dealership C contains 1 car and 2 bikes.
Number of tyres in Dealership A is (2 x 4) + (4 x 2) = 16. For Dealership B (4 x 5) + (2 x 0) = 20. Similarly for Dealership C (1 x 4) + (2 x 2) = 8.
6th Question
Problem Statement: Write a function that can solve the following equation a3 + a2b + 2a2b + 2ab2 + ab2 + b3. The program should accept three values for a, b and c and return the result for above equation.
Test Case:
Input: 1 2 3
Output: 27
Program in C:
//Learnprogramo - programming made simple #include <stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); int sum; sum=(a+b)*(a+b)*(a+b); printf("%d",sum); }
Output:
Frequently Asked Questions (FAQ)
Q.1 What is the Purpose of this Coding Round?
Ans: The Capgemini started conducting coding rounds this year to check the problem-solving skills of candidates.
Q.2 How many Questions are there in Capgemini?
Ans: A total of 3 questions are asked and you’ve to solve them in the time period of 75 minutes.
Q.3 What is the difficulty of Coding Questions?
Ans: The candidates who will clear this round will get a package of 7.5 LPA that’s why the difficulty level of this round is high and difficult.
Q.4 On which platform this coding round will be conducted?
Ans: Capgemini is using the Cocubes platform to conduct all their tests.
Q.5 Does Capgemini Ask Coding Questions?
Ans: Yes Capgemini asks coding questions for those who’ve applied for higher posts such as analysts with 7.5 LPA.
Q.6 Is their Coding Round in Capgemini?
Ans: Yes, Capgemini also conducts coding rounds for higher posts which consist of 3 questions with a time of 75 minutes.
Q.7 Does Capgemini take the Coding Test?
Ans: Yes, from this year onwards Capgemini is taking the Coding test to check the problem-solving ability of the candidates.
Conclusion
So, in this way we’ve solved the Capgemini Coding Questions and Answers with their outputs. If you’ve any doubts then please feel free to contact us. We’ll reach you as soon as possible.
Thanks and Happy Coding :)
Also Read:
- Capgemini Exam Pattern.
- Amcat Coding Questions.
- Mindtree Coding Questions.
- Cocubes Test.
- TCS Codevita.
- Zoho Aptitude Questions.
- Wipro Coding Questions.
- Hexaware Interview Questions.
- Accenture Coding Questions.
- Cognizant Coding Questions.
- Infosys Pseudo Code Questions.