# Capgemini Pseudo Code MCQs

Hello friends in this post we are going to discuss about Capgemini Pseudo Code MCQ with answer | Capgemini Pseudo Code MCQ Dumps | Capgemini Pseudo Code Objective type question with answer | Capgemini Pseudo Code Multiple choice questions with answer

## 1) What will be the value of s if n=127?

i=0,s=0
Function Sample(int n)
while(n>0)
r=n%l0
p=8^i
s=s+p*r
i++
n=n/10
End While
Return s;
End Function

a) 27
b) 187
c) 87
d) 120

Ans: C

A) 3 2 1

B) 3 1
c) 3
d) Infinite Loop

Ans: D

a) 56
b) 78
c) 72
d) 68

Ans: D

a) 3
b) 4
c) 2
d) 1

Ans: D

## 5) What will be the value of t if a =56 ,b = 876?Read a,bFunction mul(a, b)t = 0while (b != 0)t = t + ab=b-1End Whilereturn t;End Function

a) 490563
b) 49056
c) 490561
d) None of the mentioned

Ans: B

a) Line 4
b) Line 6
c) Line 7
d) No Error

Ans: C

## 7) What is the time complexity of searching for an element in a circular linked list?

a) O(n)
b) O(nlogn)
c) O(1)
d) None of the mentioned

Ans: A

a) log 2 n
b) n ?2
c) log 2 n 1
d) n

Ans: D

a) O(n)
b) O(n!)
c) O(n log n)
d) O(n^C)

Ans: A

a) 0
b) 25
c) 26
d) 1

Ans: B

a) 2n + 8

b) 2n + 4
c) 2n + 2
d) 2n

Ans: A

a) 56
b) 88
c) 72
d) 65

Ans: C

a) 6
b) 5

c) 10
d) 15

Ans: D

a) 21
b) 15
c) 9
d) 6

Ans: A

a) 3, 0, and 1
b) 3, 3, and 3
c) 4, 0, and 1
d) 3, 0, and 2

Ans: A

a) O(n2)
b) O(nLogn)

c) ?(nLogn)
d) O(n3)

Ans: A

a)O(n)
b)O(m+n)
c)O(n2)
d)O(mn)

Ans: C

a)t1 = 5
b)t1 < t2

c)t1 > t2
d)t1 = t2

Ans: C

## 19) What does the following piece of code do?public void func(Tree root){func(root.left());func(root.right());System.out.println(root.data());}

a)Preorder traversal
b)Inorder traversal

c) Postorder traversal
d)Level order traversal

Ans: C

## 20) How will you find the minimum element in a binary search tree?

a) public void min(Tree root)
{
while(root.left() != null)
{
root = root.left();
}
System.out.println(root.data());
}
b) public void min(Tree root)
{
while(root != null)
{
root = root.left();
}
System.out.println(root.data());
}
c) public void min(Tree root)
{
while(root.right() != null)
{
root = root.right();
}
System.out.println(root.data());
}
d) public void min(Tree root)

{
while(root != null)
{
root = root.right();
}
System.out.println(root.data());
}

Ans: A