Professional Documents
Culture Documents
https://www.youtube.com/PappuCareerGuide
Capgemini has changed its hiring pattern and its new section game based
Aptitude Test has 4 Aptitude based games to be played, these games are
randomly selected from 24 games present in the system. The following are some
Games asked in Capgemini test previously
1. Deductive Logical Thinking(Geo-Sudo)
2. Inductive-logical Thinking
3. Grid Challenge
4. Motion Challenge
5. Switch Challenge
6. Digit Challenge
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
There are 18 more such games in Capgemini Game Based Aptitude Test.
Here are some questions and answers that will help you understand how the Game Based
Aptitude Test works.
Answer: 3241
Explanation:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
From the given row,
In the final row, the order is plus sign, triangle, circle, square which can be translated as 3241.
Q2. Pick the one that doesn’t fit the group.
th
Answer: (V figure)
Explanation:
In the given series of IX figures (say I to IX), each figure contains 5 horizontal lines (say 1 to 5).
Exactly one of the lines is broken in the order of 1, 2, 3, 4, 5, 4, 3,2, 1 from figures I to IX
th
respectively. But this order is missed in the V figure. Hence is the odd man.
Q3. Pick the one that doesn’t fit the group.
rd
Answer: III figure
Explanation:
In each of the given IX figures there are two shapes, out of which, one is shaded and the other is
unshaded. But only in the third figure, the two shapes overlap each other. Hence is the odd man.
Q4. Find the missing part.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer:
+
Explanation:
Each row/ column should have all the four shapes (triangle, plus sign, square, circle).
If we consider column 4, grid 14 should be occupied by a circle. So, the grid 13 will be occupied
by a plus sign.
Q5. Enter the unique digits that satisfy the given equation.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer: 3 × 4 + 8 = 20
Q6 . Choose Correct Answer?
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer.
Explanation:
Rule followed by grids given in the question: Row 1 and Row 3 are identical.
Q7. Identify the pattern in which the question grids are coloured and following the same pattern
colour the given grids.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer:
Explanation:
The grids with 4 ‘Z’s are coloured yellow and the remaining grids are coloured black.
Q8.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer: 3241
Explanation:
After the operator 4312 the order changes as: Rhombus, Triangle, Plus sign, Circle
From this order to get the given final order of Plus sign, Triangle, Circle, Rhombus, the required
operator is 3241.
Q9. Move the red ball to the hole (marked black) in the given grid.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Now, the red ball can be taken to the destination without obstacles.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Q10. Enter the unique digits that satisfy the given equation.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer: 3 × 8 + 6 = 30
Q11. Remember the order in which the dots appear on a grid. In between the grids some
questions are to be answered whether the given pictures are symmetrical or not. At last the dots
are to be marked as per the order.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
+++
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
+++
Explanation:
From the right end, the number of plus signs inside a box increases by 1 in each consecutive
figures. But the order is missed at the fifth figure and hence is the odd one.
Q13. Identify the pattern in which the question grids are coloured and following the same pattern
colour the given grids.
Answer:
Explanation:
The grids with only numbers are marked grey while the grids with both numbers and alphabets
are marked green.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer:
Triangle
Explanation:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
To find the part to be filled on grid 12, let us first consider other grids related to it.
Grid 51 – Square;
Grid 21 – Triangle;
Grid 11 – Circle;
Grid 45 – Triangle;
Grid 15 – Star;
Answer:
5th image
Explanation:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Each row and column should have exactly one cross mark. As the pattern already exists on the
question figure, the missing part should not contain any cross marks.
Deductive Logical Thinking (Geo-Sudo Challenge)
Rules to Solve
Problem Statement: 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
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
One geometrical shape can only occur once, in any row or any column
Marking Scheme
Rules to Solve
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.
Marking Scheme
Motion Challenge
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Rules to Solve
Problem Statement: You’re a Jim, you love to solve puzzles, your challenge is to put the red ball into
the hole, but hey, there are obstacles, some are plastic obstacles that you can move, some are hard
rocks, you can’t move them. Try to do this in minimum number of steps to earn candy.
Note – You can move plastic blocks, over the black whole
Everytime you solve a maze correctly you level up.
In each level the difficulty of the problem increases.
To reward users, each level has a higher marking scheme as given below –
We are testing users, visual reasoning, decoding, problem solving skills
The above test is ideal for jobs that require solving complex problems : Engineers, Finance,
Accounts, HR, Software etc
Marking Scheme
Rules to Solve
Problem Statement: You’re Shakuntala Devi, and you are good with memory, you will need to do 2
tasks simultaneously, you will be shown a grid with many coordinates, with one highlighted then two
figures.
Marking Scheme
Rules to Solve
Problem Statement: You will be show a few figures your job, is to mark image/images that don’t fit
the rule logically.
Marking Scheme
Marking Scheme
Rules to Solve
Problem Statement:
In the first section you will see 6 tables, having a combination of numbers, alphabets and
colors
In the second section, 4 other tables, which needs to be assigned color. Based on rules that
you observed in the above 6 tables.
The above test is ideal for jobs that require solving complex problems : Engineers, Finance,
Accounts, HR, Software etc
Marking Scheme
#include<stdio.h>
int main()
{
char ch;
int i;
scanf("%c", &i);
scanf("%d", &ch);
printf("%c %d", ch, i);
return 0;
}
Error: suspicious char to in conversion in scanf()
Error: we may not get input for second scanf() statement
No error
None of above
Question: Consider the following iterative implementation to find the factorial of a number:
int main()
{
int n = 6, i;
int fact = 1;
for(i=1;i<=n;i++)
_________;
printf("%d",fact);
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
return 0;
}
Which of the following lines should be inserted to complete the above code?
fact = fact + i
fact = fact * i
i = i * fact
i = i + fact
Question: How will you find the maximum element in a binary search tree?
a)
public void max(Tree root)
{
while(root.left() != null)
{
root = root.left();
}
System.out.println(root.data());
}
b)
public void max(Tree root)
{
while(root != null)
{
root = root.left();
}
System.out.println(root.data());
}
c)
public void max(Tree root)
{
while(root.right() != null)
{
root = root.right();
}
System.out.println(root.data());
}
d)
public void max(Tree root)
{
while(root != null)
{
root = root.right();
}
System.out.println(root.data());
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
}
10
1
10 9 8 … 1 0
10 9 8 … 1
What is the output of the code given below? Now, let us take up a small test.
1#include <stdio.h>
2int main()
3{
4 char ch = 'A';
5 printf("%d\n", ch);
6 return 0;
7}
1. A
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
2. 'A'
3. 65
4. 97
Solution: The output of this code snippet might have been A if the format specifier mentioned in the
print statement would be character format specifier - '%c'. But since the format specifier is integer
format specifier - '%d', the ASCII code character A which is 65 is retrieved as the output. A
Writing code all starts with knowing the coding constructs. The basic coding constructs of any
programming language are data types. You might be tested on knowing more about the data types
and the qualifiers not used frequently. You may come across a question of this kind.
1.short int x;
2.signed short x;
3.short x;
4.unsigned short x;
1. 3 and 4
2. 1
3. 2
4. All are valid
Solution:All are valid. First 3 mean the same thing. 4th means unsigned.
Expression Evaluation is the favorite question to test your knowledge about combinations of
different mathematical operators.
1#include <stdio.h>
2int foo(int* a, int* b)
3{
4 int sum = *a + *b;
5 *b = *a;
6 return *a = sum - *b;
7}
8int main()
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
9{
10 int i = 0, j = 1, k = 2, l;
13 return 0;
14}
1. 1 2 1 1
2. 1 1 2 1
3. 1 2 2 1
4. 1 2 2 2
Solution: 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
Enroll for Free Online CRT Course - Online Classes - Practice Question
1#include <stdio.h>
2int i;
3int main()
4{
5 if (i);
6 else
7 printf("Ëlse");
8 return 0;
9}
1. if block is executed.
2. else block is executed
3. It is unpredictable as i is not initialized.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Solution: Since i is defined globally, it is initialized with default value 0. The else block is executed as
the expression within if evaluates to FALSE. An empty block is equivalent to a semi-colon(;). So the
statements if (i);andif (i) {} are equivalent.
We can divide a large program into the basic building blocks known as a function. The function
contains the set of programming statements enclosed by {}. A function can be called multiple times
to provide reusability and modularity to a program. In other words, we can say that the collection of
functions creates a program.
You can be given a function and ask you the functionality of the function.
1{
2 int tmp;
3 tmp = x;
4 x = y;
5 y = tmp;
6}
7
Solution: 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:
1{
2 int tmp;
3 tmp = x;
4 x = y;
5 y = tmp;
6}
7
As per the above discussion, you might have got some clarity on the kind of questions that you
might come across in this Capgemini Pseudo Code Online test. Having a quick revision on format
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
specifiers, data types, functions, expression statements, conditional statements, looping constructs
makes facing this section of the Capgemini recruitment process with great aplomb.
The syllabus for Capgemini pseudo code MCQs section is as given below. Questions will be
mostly on these topics only.
Integer i
Set i = 3
do
print i + 3
i=i-1
while(i not equals 0)
end while
[Note: A do while loop is a control flow statement that executes a block of code at least once, and
then repeatedly executes the given Boolean condition at the end of the block]
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
A) 6 6 6
B) 6 5 6
C) 5 5 5
D) 6 5 4
Ans: D
Explanation:
In this program, one variable declared as i, and value initialized as 3. We are moving with do-
while(Do while will execute the statement once and then it will check the condition).
Step 1:
It will print i+3, here i value is 3. So i+3 is 6. On the next line, i will be decremented by 1. Then
checking the conditions in do-while() i!=0. Here updated i value is 2 (2!=0),so condition is true. The
loop continues.
Step 2:
It will print i+3, here updated i value is 2. So i+3 is 5. On the next line i will be decremented by 1.
Then checking the conditions in do-while() i!=0. Here updated i value is 1 (1!=0),so condition gets
true. The loop continues
Step 3:
It will print i+3, here updated i value is 1. So i+3 is 4. On the next line i will be decremented by 1.
Then checking the condition in do while() i!=0. Here updated i value is 0 (0!=0),so condition gets
false. Thus the loop gets terminated!
int i=3;
do{
cout<<i+3; => 3+3 =6 =>2+3 =>5 =>1+3=4
i=i-1; => 3-1=2 =>2-1 =>1 =>1-1=0
}while(i!=0);
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Integer a
String str1
Set str1 = “goose”
a = stringLength(str1)
Print (a ^ 1)
[Note- string-length(): string-length() function counts the number of characters in a given string and
return the integer value.
^ is the bitwise exclusive OR operator that compares each bit of its first operand to the
corresponding bit of its equal operand. If one bit is 0 and the other bit is 1, the corresponding result
bit is set to 1. Otherwise, the corresponding result bit is set to 0]
A) 0
B) 4
C) 5
D) 3
Ans: B
Explanation:
There are two variables a and str1. Value initialized for str1 is “goose”. On the next line, we are
finding the length of str1 that is 5. Finally, printing the output of a bitwise exclusive OR operator with
1. And the answer is 4.
Integer a, b, c
Set a = 8, b = 51, c = 2
c = (a ^ c)^ (a)
b = b mod 4
Print a + b + c
[Note- mod finds the remainder after the division of one number by another. For example, the
expression “5 mod 2” would evaluate to 1 because 5 divided by 2 leaves a quotient of 2 and a
remainder of 1
^ is the bitwise exclusive OR operator that compares each bit of its first operand to the
corresponding bit of its equal operand. If one bit is 0 and the other bit is 1, the corresponding result
bit is set to 1. Otherwise, the corresponding result bit is set to 0]
A. 13
B. 17
C. 26
D. 16
Ans:A
Explanation:
There are three variables a, b and c declared. Value initialized for a is 8, b is 51 and c is 2.
When we do a bitwise exclusive OR of (8^2), the answer is 10. Again 10 bitwise exclusive OR of a
i.e (10 ^ 8) is 2, which will be stored in variable c.
Then taking modulo operation for b by 4 (b%4) the answer is 3
Finally adding all the updated values of a,b, and c (8+2+3 ) and the output of Pseudocode is 13.
int main()
{
int a=8,b=51,c=2;
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
c = (a ^ c)^ (a); =>(8^2) ^(8) => 10 ^ 8 => 2
b = b % 4; =>3
cout<<a + b + c; =>8+2+3 => 13
}
Note: ^ is the bitwise exclusive OR
Q4. Consider an array A = {1, 2, 4, 5, 6, 11, 12} and a key which is equal to 10. How many
comparisons would be done to find the key element in the array using the binary search?
A. 5
B. 1
C. 2
D. 3
Ans: D
Explanation:
There is an Integer Array A = {1, 2, 4, 5, 6, 11, 12} and the key value is 10.
We know that binary search takes log n base 2 time to search for a particular element.
If there are N elements in the set you have chosen binary search then take log n base 2 time.
1)First, you check how many elements in your array. if an element in your array is greater than 1
then you go for the next step.
2)Binary search divides the problem into two parts using the mean of the total number of an element
which is sorted mean=(0+n)/2
3)And compare the searching element which is either greater the mean or lesser or equal to the
mean .then after comparison skip the one part either greater part or small part depends on the result
or searching is done if the mean is equal to the searching element. So that problem is divide into n/2
and goes until searching is done.
If you apply the recursive equation for the binary search algorithm then
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
T(n)=T(n/2)+1 to solve the problem
n/2^k=1
taking log on both sides
log n=log (2^k)
log n= k log 2
k=log n base 2.
N=7
K=log 7 base 2 = 3
K=3
Integer i, j, k
Set k = 8
for(each i from 1 to 1)
for(each j from the value of i to 1)
print k+1
end for
end for
A. 2
B. 9
C. 7
D. 8
Ans: B
Explanation:
There are three variables i, j and k declared. Value initialized for k is 8, In this code, we are moving
with nested for loop.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Here I value is 1, for loop will check the condition i<=1 condition gets true. Now, moving with inner
for loop j value will be 1 condition gets true j<=1.so, it prints K+1. Then j value will be incremented by
1(2<+1) inner for loop condition gets false.
On the next iteration i value will be incremented by 1, here updated i value is 2 (2<=1) condition get
false. So the answer is 9.
Integer a, b
Set a = 15, b = 7
a = a mod (a - 3)
b = b mod (b – 3)
a = a mod 1
b = b mod 1
Print a + b
A) 15
B) 7
C) 2
D) 0
[Note-mod finds the remainder after the division of one number by another. For example, the
expression “5 mod 2” leaves a quotient of 2 and a remainder of 1]
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Answer: 0
Explanation:
There are two variables a and b declared. Value initialized for a is 15 and b is 7. Taking mod
operation for a by 12(a%12) and the answer is 3 will stored in a.
The next mod operation for b is 7 mod (7%4). The answer is 3 will be stored in b.
The next line takes the updated value of a and mods it by 1(3%1). Then the answer becomes 0 will
be stored in a.
Next line takes the updated value of b mod by 1 (3%1) then the answer is 0. Finally adding all the
updated values of a and b (0+0 ) and the output of Pseudocode is 0.
Integer a, b, c
Set b = 5, a = 2, c = 2
if(b>a && a>c && c>b)
b=a+1
Else
a=b+1
End if
Print a + b + c
[Note-&&: Logical AND - The logical AND operator (&&) returns the Boolean value true(or 1) if both
operands--. If (x) gets executed if the value if(), i.e., x is not zero]
A) 2
B) 13
C) 26
D) 5
Ans:B
Explanation:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
There are three variables a, b and c declared. Value initialized for a is 2, b is 5 and c is 2.
Checking the condition using if, b >a and a>c and c>b here if conditions get false. Now else part will
execute b value will be incremented by 1 and stored in a, Finally adding all the updated values of a,
b and c (6+5+2 ) and the output of Pseudocode is 13.
Q8. For which of the following applications can you use hashing?
1. To construct a message authentication code.
2. For Timestamping
3. For detecting a cycle in a graph
Choose the correct answer from the options given below.
A. Only 1 and 3
B. Only 2 and 3
C. Only 1
D. Only 1 and 2
Ans:D
Explanation:
Constructing a message authentication code and Timestamping are the real-time applications for
hashing.
Q9. Consider an array of float. Calculate the difference between the address of the 1st and 4th
element, assuming float occupies 4 bytes of memory.
A. 16
B. 4
C. 12
D. 8
Ans: C
Explanation:
Let's consider the address of elements:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
1st element – 1000 - 1003 (4 bytes)
2nd element – 1004 - 1007 (4 bytes)
3rd element – 1008 – 1011 (4 bytes)
4th element - 1012 – 1015 (4 bytes)
The difference between the address of the 1st and 4th element is 12.
Q10. What is the second part of a node in a linked list that contains the address of the next node
called?
A. data
B. pointer
C. element
D. Link
Ans:D
Explanation:
The field of each node that contains the address of the next node is usually called the 'link'.
Q11. If you are using Depth-first search (DFS) for traversing an unweighted graph, then which of the
following will happen?
1. It produces the minimum spanning tree
2. It produces all pair shortest path tree
Choose the correct answer from the options given below.
A. Both 1 and 2 are true
B. Both 1 and 2 are false
C. Only 2 is true
D. Only 1 is true
Ans:D
Explanation:
Depth-first search (DFS) for traversing an unweighted graph, will produce the minimum spanning
tree.
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Only Depth-first search (DFS) for traversing an weighted graph, will produce all pair shortest-path
tree.
Q12. With the given the information provided find out the address of Arr[17] in a 1-D array Arr[30].
- lower bound = 1
- starting base address = 1100
- size of each element is 2.
A. 1132
B. 1070
C. 1128
D. 1068
Ans: A
Explanation:
We need to find the address of Arr[17]. Starting base address is 1100.
Arr[1] – 1100 (2bytes)
Arr[2] – 1102 (2bytes)
Arr[3] – 1104 (2bytes)
Arr[4] – 1106 (2bytes)
Arr[5] – 1108 (2bytes)
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Arr[6] – 1110 (2bytes)
Arr[7] – 1112 (2bytes)
Arr[8] – 1114 (2bytes)
Arr[9] – 1116 (2bytes)
Arr[10] – 1118 (2bytes)
Arr[11] – 1120 (2bytes)
Arr[12] – 1122 (2bytes)
Arr[13] – 1124 (2bytes)
Arr[14] – 1126 (2bytes)
Arr[15] – 1128 (2bytes)
Arr[16] – 1130 (2bytes)
Arr[17] – 1132 (2bytes)
A) 25
B) 5
C) 50
D) 40
Ans: C
Explanation:
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
There is an array of integer arr[]={10,20,30,40,50}. There are two variables a and b declared. . The
value initialized for s is 0. On next line adding the 1 st index value 20 and 2nd index value 30 arr[1] +
arr[2]( 20+30) the answer is 50 will be stored in a. Finally printing the updated values of a is 50.
Integer a, b, c
Set b = 2, a = 2
c=a^b
Print c
[Note- ^ is the bitwise exclusive OR operator that compares each bits of its first operand to the
corresponding bit of its-- other bit is 1, the corresponding result bit is set to 1. Otherwise, the
corresponding result bit is set to 0]
A) 6
B) 4
C) 0
D) 2
Ans:C
Explanation:
There are three variables a, b and c declared. Value initialized for a is 2 and b is 2. When we do a
bitwise exclusive OR of c i.e (2^2), the answer is 0. Finally, print the value of c.
Q15. Which of the following series will be printed by the given pseudocode?
Integer i, j, k, n
Set j=1, k=1
for(each i from 1 to 5)
print k
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
j=j+1
k=k+j
end for
A) 1 3 6 10 15
B) 1 2 3 4 5
C) 2 4 6 8 10
D) 1 1 2 3 5
Ans:A
Explanation:
There are four variables i, j,k and n declared. Value initialized for j is 1 and k is 1.
For loop, i value starts from 1 loop will run till the i<5, In the first iteration i value, is 1, printing k value
is 1. Next line j value will be incremented by 1 (1+1) =>2. On the next line adding k and j (1+2), then
the answer is 3.
2nd iteration i value will be incremented by 1, i=2. Print k, the updated k value is 3. on the next line j
value will be incremented by 1 (2+1) =>3. On the next line adding k and j (3+3) , then the answer is
6.
3rd iteration i value will be incremented by 1, i=3. Print k, the updated k value is 6. on the next line j
value will be incremented by 1 (3+1) =>4. On the next line adding k and j (6+4) , then the answer is
10.
4th iteration i value will be incremented by 1, i=4. Print k, the updated k value is 10. on the next line j
value will be incremented by 1 (4+1) =>5. On the next line adding k and j (10+5) , then the answer is
15.
5th iteration i value will be incremented by 1, i=5. Print k, the updated k value is 15. Next line j value
will be incremented by 1 (5+1) =>6. On the next line adding k and j (15+6), then the answer is 21.
Here for loop condition gets false, it comes out of the for loop. The output of Pseudocode is 1 3 6 10
15.
Question 1:
Find the output of the following pseudo-code:
Integer x,y,z;
x=0
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
y=1
x=y=z=8
Print x
Options:
A) 0
B) 8
C) 1
D) None of the above
Question 2:
Find the output of the following pseudo-code:
Integer value, n
Set value = 1, n = 45
while(value less than equal to n)
value = value << 1
end loop
Print value
Options:
A) 64
B) 32
C) 45
D) None of the above
Question 3:
Find the output of the following pseudo-code:
Integer c, d
Set c = 15, d = 12
d=c–1
Print c //line
c = d + (c – 2)
if(c < 40)
Goto line
end if
Options:
A) 14 26 38
B) 27 39
C) 15 27 39
D) None of the above
Question 4:
Find the output of the following pseudo-code if x= 4 and y=5:
Integer fun(int x, int y)
if(x > 1)
fun(x – 2, y + 2)
end if
print y
End function fun()
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Options:
A) 4 5 6
B) 7 6 5
C) 9 7 5
D) None of the above
Options:
A) 2
B) 3
C) 1
D) 0
Options:
A) 2
B) 4
C) 3
D) 1
Question 7:
What will be the output of the following pseudo code?
Integer x, y, z
Set x=24, y=8
x = x/y
z = y<<x
Print z
[Note: << is left shift operator, it takes two numbers, left shifts the bits of the first operand, the
second operand decodes the number of …]
Options:
A) 1
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
B) 8
C) 0
D) 64
Question 8:
What will be the output of the following pseudocode?
Integer x, y, z, a
Set x = 2, y = 1, z = 5
a = (x AND y) OR (z + 1)
Print a
Options:
A) 5
B) 3
C) 2
D) 1
Question 09:
What will be the output of the following pseudocode?
Integer a=5, b=4, c=3
a=b+c
c=a–b
c=c+a
c=b+c
b=b+c
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Print a, b, c
Options:
A) 7 14 7
B) 7 14 10
C) 7 8 14
D) 7 18 14
Question 10:
What will be the output of the following pseudocode?
Integer a, b, c, d
Set b = 18, c = 12
a=b–c
for (each c from 1 to a – 1)
b = b + c + 12
b = b/5
d=b+a
end for
c=a+b+c
Print a b c
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Options:
A) 5 3 9
B) 6 14 17
C) 6 4 14
D) 6 4 16
Question 11:
Which of the following operations is possible on an array?
Options:
A) All of the mentioned options
B) Insertion
C) Searching
D) Sorting
Options:
A) Union
B) Assignment
C) Primitive
D) None of the above
Question 13:
What do we call the binary tree nodes with no successor?
Options:
A) End nodes
B) Terminal nodes
C) Last nodes
D) Final nodes
Question 14:
What do we call the highest element of an array’s index?
A) Upper bound
B) Lower bound
C) Range
D) Extraction
Question 15:
Which of the following data types represents many to many relations?
A) Both plex and graph
B) Graph
C) Plex
D) Tree
Question 16:
Question 17:
Each node of the graph is represented as a _______?
A) Vertex
B) Root
C) Path
D) Edge
Question 18:
Recursion uses more memory space than iteration. Which of the following is/are the valid reason for
the same?
A. It uses the stack instead of a queue
B. Every recursion call has to be stored
Choose the correct answer from the options given below.
A) Only A
B) Both A and B
C) Neither A nor B
D) Only B
Capgemini Complete Study Materials by Pappu Career Guide
https://www.youtube.com/PappuCareerGuide
Correct answer: Option A
Explanation: Recursive functions use stack as the memory space technique. And also as rightly
pointed out the call has to be present to store the returned values.
Question 19:
To which of the following domain problem does the knapsack problem belong?
A) NP- complete
B) Sorting
C) Optimisation
D) Linear Solution