Assessment Pattern:
Pseudo Code
Questions: 30 Time: 30 Min
English Communication Test
Questions: 30 Time: 30 Min
Behavioral Test
Questions: 100 Min Time: 20 Min
Game Test
Questions: 4 games out of 24 Time: 22-24 Min
Question 1
Answer
Question 1
What will be the output of the following pseudocode?
Integer i
Set i = 3
do
print i + 3
i = i – 1
while(i not equals 0)
end while
A) 6 6 6 B) 6 5 6 C) 5 5 5 D) 6 5 4
Answer
D) 6 5 4
Question 2
Answer
Question 2
What would be the output of the following pseudocode?
Integer a
String str1
Set str1 = “goose”
a = stringLength(str1)
Print (a ^ 1)
A) 0 B) 4 C) 5 D) 3
Answer
B) 4
Question 3
Answer
Question 3
What would be the output?
#include <stdio.h>
int main()
{
long double a;
long double b;
int arr[sizeof(!a+b)];
printf(“%d”,sizeof(arr));
}
A. Run time Error B. 32 C. 64 D. No output
Answer
C. 64
Question 4
Answer
Question 4
What is output?
READ x =4, y = 0;
READ z; z = (y++, y);
WRITE z
A. 1
B. 0
C. Undefined Behavior due to order of evaluation can be different.
D. Compilation Error
Answer
A. 1
Question 5
Answer
Question 5
What would be the output of the following pseudo-code?
Integer a, b, c
Set a = 8, b = 51, c = 2
c = (a ^ c)^ (a)
b = b mod 4
Print a + b + c
A. 13 B. 17 C. 26 D. 16
Answer
A. 13
Question 6
Answer
Question 6
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
Answer
D. 3
Question 7
Answer
Question 7
READ ch value between 1 & 2
switch(ch, ch+1)
case 1: WRITE “1”
break;
case 2: WRITE “2”
break;
default: WRITE “3”
A. 1 3 B. Error: Undefined condition in switch C. 1 D. No output
Answer
C. 1
Question 8
Answer
Question 8
What is the output of given code for input 134:
FUNCTION fun1(INPUT num)
static int a=0;
IF (num>0)
a=a+1;
fun1(num/10);
ELSE return a;
END FUNCTION
A. 2 B. 3 C. Runtime Error D. None of these
Answer
B. 3
Question 9
Answer
Question 9
What would be the output of the following pseudocode?
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
Answer
B. 9
Question 10
Answer
Question 10
What will be the output of the following pseudocode?
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
Answer
D) 0
Question 11
Answer
Question 11
What will be the output of the following pseudocode?
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
A) 2 B) 13 C) 26 D) 5
Answer
B) 13
Question 12
Answer
Question 12
What will be output of given pseudo code for input 7:
1. read the value of n
2. set m=1,t=0
3. if m >= n
4. go to line 9
5. else
6. t=t+m
7. m+=1
8. go to line 3
9. display T
10. stop
A. 32 B. 76 C. 28 D. 21
Answer
D. 21
Question 13
Answer
Question 13
READ n=2
FUNCTION fun(int n)
IF(n == 4) return n;
ELSE return 2*fun(n+1);
A. 4 B. 8 C. 16 D. Error
Answer
C. 16
Question 14
Answer
Question 14
What will be output of given pseudo code:
int i=5, j=7;
if ( i+j> 5)
j = i+2;
if ( j<5 )
print(i)
else
print(j)
else
print(i+1)
A. 12 B. 5 C. 7 D. 6
Answer
C. 7
Question 15
Answer
Question 15
What will be output of given pseudo code?
READ INTEGER j=41, k= 37
j=j+1
k=k-1
j=j/k
k=k/j
print(k,j)
A. 42 36 B. 36 1 C. 1 1 D. 1 36
Answer
B. 36 1
Wipro Previous Year Questions
Question 16
Answer
Question 16
#include<stdio.h>
using namespace std;
int main()
{
int a =0,b=1,c=2;
*( ( a+1==1) ? &b : &a)= a? b : c;
printf(“%d, %d, %d \n”, a , b, c );
return 0;
}
A. 0 1 2 B. 0 2 0 C. 0 2 2 D. Error
Answer
C. 0 2 2
Question 17
Answer
Question 17
What will be the output of the given pseudocode for s1=3 and e1=6?
READ s1,e1
FUNCTION num(INT s1,INT e1)
IF(s1==e1)
RETURN s1
ELSE
RETURN s1+num(s1+1,e1)
ENDIF
END FUNCTION
A.12 B.15 C.18 D.6
Answer
C.18
Question 18
Answer
Question 18
world=181
FUNCTION hello(int world)
INITIALIZE integer zero=0, integer remindme
WHILE world <> 0
remindme=world%10;
zero=zero*10+remindme
hello(world/10)
ENDWHILE
WRITE zero
ENDFUNCTION
A. zero B. 181 C. 18 D. 1
Answer
B. 181
Question 19
Answer
Question 19
consider the following pseudocode:
number=122,567,789,543,536,999
Sum=0 Counter=0 Average=0
Input(number)
While number <>999
Sum=sum+number
Counter=counter+1
Input(number)
Endwhile
Average=sum/counter
Output(“The average of the numbers is”,average:6:2)
A. 592.66 B. 511.40 C. 999.08 D. 3556.66
Answer
B. 511.40
Question 20
Answer
Question 20
Set x to 1
Set y to 1
while(x<20)
write x
x=x+5
y=y+5
End while
A. 1 1 6 6 11 11 16 16
B. 1 5 10 15
C. 1 6 11 16
D. None of these
Answer