You are on page 1of 6

Name_ Aakash Singh

Unr no._ 1900560100001


College_ BABU BANARASI DAS NORTHERN INDIA INSTITUTE OF TECHNOLOGY
Email-id_ aakashsingh8573842300@gmail.com

Campus Assessment Test

Aptitude (5 minutes)
1. I travel to work by bus and train. If my bus journey takes 28 minutes and my
train journey takes 35 minutes longer, what is the total travelling time in hours
and minutes?
a. 1 hour 3 minutes
b. 1 hour 31 minutes
c. 2 hour 1 minute
d. 2 hour 31 minute
Answer_Correct Option is b(1 hour 31 minutes)
Reason_Given,time taken in bus journey=28 minutes.Since train journey takes 35
munutes longer,then time taken is train journey=(28+35)minutes=63 minutes.
Thus total travelling time=(28+63)minutes=91 minutes=1 hour 31
minutes.

2. Find five consecutive digits in this number "5823639472165834259423" that


total 21.

Answer_Here is the answer=72165 that become the total of 21.


7+2+1+6+5=21

3. Jo’s age plus Mo’s age is 27;and Jo’s age plus Flo’s age is 38;and Mo’s age
plus Flo’s age is 33.Therefore, how old are Jo, Mo and Flo?
a. Jo 16, Mo 11, Flo 22
b. Jo 22, Mo 11, Flo 16
c. Jo 11, Mo 22, Flo 16
d. None of the above

Answer_Correct option is a(Jo 16,Mo 11,Flo 22)


Reason_ Given, Jo's age plus Mo's age is 27,and Jo's age plus Flo's age is 38,Mo's
age plus Flo's age is 33.Let the age of Jo,Mo,and Flo be equal to x,y and z.Then,
x+y=27 _(1)
x+z=38 _(2)
y+z=33 _(3)
from equation 1 y=27 - x
Substitute this in equation 3.
27 - x + z=33 _(4)
Add equation 2 and 4.
x + z +27 - x + z=38+33
2z + 27=71
2z=71 - 27 =>z=44/2=22
Substitute z=22 in equation 3.
y + z=33
y + 22=33
y=33 - 22
y=11
Substitute z=22 in equation 2.
x + z=38
x + 22=38
x=38 - 22=16
x=16
Hence, the age of Jo's=16 ,Mo's=11 and Flo's=22.
4. The average of three numbers is 29. The average of two of these numbers is
41. What is the third number?
Answer_ The third number is 5.
Reason_ Given,Average of three numbers=29,Average of two numbers=41.Let x1,x2 and
x3 be three numbers.
Now,
Mean=sum of all observations/Total number of observations
(x1+x2+x3)/2=29
x1+x2+x3=87 _(1)
(x1+x2)/2=41
x1+x2=82 _(2)
Subtracting the two equations,we get x1+x2+x3 - (x1+x2)=87
- 82
x3=5
Thus,the third number is 5.
5. If tax is charged at 22% on the first Rs. 55,000 and 35% on all income in
excess of Rs 55,000, how much tax is charged on an income of Rs.80,000?
a. Rs. 21750
b. Rs. 20750
c. Rs. 20850
d. Rs. 21850
e. None of the above
Answer_Correct option is c(Rs 20850)
Reson__ Given ,Tax is charged at 22% on the first Rs 55,000 and 35% on all income
in excess of Rs 55,000

Step 1 of 3 :

Calculate tax for first Rs 55,000

Here it is given that tax is charged at 22% on the first Rs 55,000

So tax for first Rs 55,000

= Rs 55,000 × 22/100

= Rs 12,100

Step 2 of 3 :

Calculate tax for income in excess of Rs 55,000

Total income = Rs 80,000

So income in excess of Rs 55,000

= Rs 80,000 - Rs 55,000

= Rs 25,000

It is given that 35% on all income in excess of Rs 55,000

Thus tax for income in excess of Rs 55,000

= Tax for Rs 25,000

= Rs 25,000 × 35/100
= Rs 8,750

Step 3 of 3 :

Calculate total tax is charged on the income of Rs 80,000

The total tax is charged on the income of Rs 80,000

= Rs 12,100 + Rs 8,750

= Rs 20,850

Data Structure and Algorithms (5 minutes)

1. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?


a. AB+ CD*E - FG /**
b. AB + CD* E - F **G /
c. AB + CD* E - *F *G /
d. AB + CDE * - * F *G /

Answer_ Correct Option is a(AB+ CD*E - FG /**)

Symbol Stack Postfix String

( (
A ( A
+ (+ A
B (+ AB
) AB+
* * AB+
( *( AB+
C *( AB+C
* *(* AB+C
D *(* AB+CD
- *(- AB+CD*
E *(- AB+CD*E
) * AB+CD*E-
* ** AB+CD*E-
F ** AB+CD*E-F
/ **/ AB+CD*E-F
G **/ AB+CD*E-FG

AB+CD*E-FG/**

2. What is the result of the following operation Top (Push (S, X))
a. X
b. Null
c. S
d. None

Answer_ Correct Option is a(X)

3. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted
one at a time, in what order will they be removed?
a. ABCD
b. DCBA
c. DCAB
d. None of the above

Answer_ Correct Option is a(ABCD)

4. The worst case of quick sort has order ..............


a. O(n2)
b. O(n)
c. O (n log2 n)
d. O (log2 n)

Answer: A

5. A technique for direct search is ............


a. Binary Search
b. Linear Search
c. Tree Search
d. Hashing

Answer: D

Logical programming questions (15 minutes)

1. What will be the output?

#include<stdio.h>
void fun(int);
int main()
{
int a=3;
fun(a);
return 0;
}
void fun(int n)
{
if(n>0)
{
fun(--n);
printf("\n%d",n);
fun(--n);
}
}

Ans : 0 1 2

2. int a = 11; int b = 12;


int c = 40;
switch (a) {
case 40: System.out.println(b);
break;
default: System.out.println(c);
}

Answer: 40

3. myList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]


for i in range(0, len(myList) ):
if i%2 == 0:
print(myList[i])

Answer:
1
3
5
7
9

Programming questions (15 minutes)

1. Write a program in C to generate the Fibonacci series

Answer:
Code:

#include<stdio.h>
int main()
{
int n1=0,n2=1,n3,i,number;
printf("Enter the number of elements:");
scanf("%d",&number);
printf("\n%d %d",n1,n2);//printing 0 and 1
for(i=2;i<number;++i)//loop starts from 2 because 0 and 1 are already printed
{
n3=n1+n2;
printf(" %d",n3);
n1=n2;
n2=n3;
}
return 0;
}

Output:
Enter the number of elements: 10
0 1 1 2 3 5 8 13 21 34

2. Write a program in C to generate the following output

*
* * *
* * * * *
* * * * * * *
Answer:
Code :

#include <stdio.h>
int main()
{

int i, j, rows, k = 0;
printf (" Enter a number to define the rows: \n");
scanf ("%d", &rows);
for ( i =1; i <= rows; i++)
{
for ( j = 1; j <= rows - i; j++)
{
printf (" ");
}
// use for loop where k is less than equal to (2 * i -1)
for ( k = 1; k <= ( 2 * i - 1); k++)
{
printf ("* "); // print the Star
}
printf ("\n");
}
return 0;
}

Output :

Enter a number to define the rows:


4
*
* * *
* * * * *
* * * * * * *

You might also like