Section A - 25 Questions (25 Marks) : Page 1 of 10
Section A - 25 Questions (25 Marks) : Page 1 of 10
a. 512
b. 343
c. 1329
d. 729
2. If in a certain language PROSE is coded as PPOQE, how is LIGHT coded in that code ?
a. LIGFT
b. LGGFT
c. LGGHT
d. LLGFE
3. Raghu tosses a coin 6 times. The probability that the number of times he gets heads will
not be greater than the number of times he gets tails is.
a. 21/64
b. 3/32
c. 41/64
d. 21/32
4. If Praveen and Naveen together can complete a piece of work in 15 days and Naveen
alone in 20 days, in how many days can Praveen alone complete the work?
a. 60
b. 45
c. 40
d. 30
5. A boat running upstream takes 8 hours 48 minutes to cover a certain distance, while it
takes 4 hours to cover the same distance running downstream. What is the ratio
between the speed of the boat and speed of the water current respectively?
a. 2:1
Page 1 of 10
b. 3:2
c. 8:3
d. Cannot be determined
6. Abhi and Vabby take part in a 100 m race. Abhi runs at 5 kmph. Abhi gives Vabby a start
of 8 m (meaning Abhi starts the race when Vabby has already covered 8m) and still
beats him by 8 seconds. The speed of Vabby is:
a. 5.15 kmph
b. 4.14 kmph
c. 4.25 kmph
d. 4.4 kmph
7. A bag contains 2 red, 3 green and 2 blue balls. Two balls are drawn at random. What is
the probability that none of the balls drawn is blue?
a. 10 / 21
b. 11 / 21
c. 5 / 7
d. 2 / 7
8. There is a 60% increase in an amount in 6 years at simple interest. What will be the
compound interest for Rs. 12,000 after 3 years (compounded annually) at the same
rate?
a. 2160
b. 3120
c. 3972
d. 6240
9. The average temperature for Wednesday, Thursday and Friday was 40 degrees celsius.
The average for Thursday, Friday and Saturday was 41 degrees celsius. If the
temperature on Saturday was 42 degree celsius, what was the temperature on
Wednesday?
a. 39
b. 44
c. 38
d. 41
10. A father said to his son, "I was as old as you are at the present at the time of your
birth". If the father's age is 38 years now, the son's age 4 years back was:
a. 34
b. 23
c. 15
Page 2 of 10
d. 19
11. The sum of the first 16 terms of an AP whose first term and third term are 5 and 15
respectively is ?
a. 600
b. 765
c. 640
d. 680
12. . There are two poles, one on each side of the road. The higher pole is 54 m high. From
the top of this pole, the angle of depression of the top and bottom of the shorter pole is
30 and 60 degrees respectively. Find the height of the shorter pole. Use the below
references of the trigonometric table and angle of depression definition.
a. 40m
b. 24m
c. 36m
d. Cannot be determined
13. The difference between a two-digit number and the number obtained by interchanging
the positions of its digits is 36. What is the difference between the two digits of that
number?
a. 3
b. 4
c. 9
d. Cannot be determined
Page 3 of 10
14. What does f1(8) return for this function.
int f1 (int n)
{
if(n == 0 || n == 1)
return n;
else
return (2*f1(n-1) + 3*f1(n-2));
}
a. 1661
b. 59
c. 1640
d. 73
int main()
{
int a=14;
while(a<20)
{
++a;
if(a>=16 && a<=18)
{
continue;
}
printf("%d ", a);
}
return 0;
}
a. 15 16 17 18 19
b. 15 18 19
c. 15 16 20
d. 15 19 20
int main ()
{
Page 4 of 10
int i, j;
int a [8] = {1, 2, 3, 4, 5, 6, 7, 8};
for(i = 0; i < 3; i++) {
a[i] = a[i] + 1;
i++;
}
i--;
for (j = 7; j > 4; j--) {
int i = j/2;
a[i] = a[i] - 1;
}
printf ("%d, %d", i, a[i]);
}
a. 2, 3
b. 2, 4
c. 3, 2
d. 3, 3
17. What’s the output of the following program?. Consider int is allocated 2 bytes of
memory in the system.
int main()
{
int a = 5, b = 9, c;
c = a ^ b // ^ means XOR operator
c = c << 2 // << Left shift operator
printf(“%d”, c);
return 0;
}
a. 0
b. 14
c. 48
d. 144
Page 5 of 10
c. Kernel is made of various modules which cannot be loaded in the running operating
system.
d. Kernel remains in the memory during the entire computer session
21. Below is a piece of code to traverse the elements of a binary tree. Which traversal does
this do?
traverse(root.left());
traverse(root.right());
printf(“%d”, root.data());
}
22. Which of the following is not true for the following code segment?
class A
{
Page 6 of 10
private : int sum(int x, int y)
{
return x+y;
}
public: A()
{
}
A(int x, int y)
{
Cout << sum(x,y);
}
};
23. Which of the following statements is incorrect regarding call by value and call by
reference parameter passing techniques.
a. In call by value, the value of the actual parameter is copied and the copy is passed to
the function.
b. In call by value, actual parameters and functions formal parameters point to the
same memory location
c. In call by reference, actual parameters and functions formal parameters point to the
same memory location.
d. In call by reference, any modifications to the parameters will be reflected in the
calling function.
24. Which key declares that an index in one table is related to that in another?
a. Primary
b. Foreign
c. Secondary
d. Relational
25. Which of the following should be used to find all the courses taught in the Aug 2020
semester but not in the Jan 2021 semester?
Page 7 of 10
a. SELECT COUNT (DISTINCT ID) FROM takes WHERE (course id, sec id, semester, YEAR)
IN (SELECT course id, sec id, semester, YEAR FROM teaches WHERE teaches.ID=
10101);
b. SELECT DISTINCT course id FROM SECTION WHERE semester = ’Aug’ AND YEAR=
2020 AND course id NOT IN (SELECT course id FROM SECTION WHERE semester =
’Jan’ AND YEAR= 2021);
c. SELECT DISTINCT course_id FROM instructor WHERE name NOT IN (’Aug’, ’Jan’);
d. SELECT course id FROM SECTION WHERE semester = 'Jan' AND YEAR= 2021);
Page 8 of 10
Section B – 5 Questions (25 Marks)
Questions 26,27,28 – Fill-in-the-blanks : Each question carries 3 marks
Question 29 – Coding – 6 marks
Question 30 – Coding – 10 marks
if(numOfChars == 1) {
} else {
reverse( __________FILL_IN_THE_BLANK_________);
28. The following program finds the maximum value contained in the array P of size n ( n > 1).
Please complete this program by filling the blank.
Page 9 of 10
int a=0, b=n-1;
while (___ FILL_IN_THE_BLANK ___)
{
if (p[a] <= p[b])
{
a = a+1;
}
else
{
b = b-1;
}
}
29. Write a function that takes 2 arguments: numberList (array of integers), baseLine (integer) and
prints the count of elements in numberList that is less than baseLine and count of elements in
numberList that is more than baseLine. Eg: numberList={10,20,30,40,50,60} and baseLine=45,
output should be
Below BaseLine : 4
Above BaseLine: 2
Note: You can write the code in Java or Python
.
30. Write a program that takes a path to a file name as an argument (.txt file), reads the file and
generates a new file that has every alternate line swapped. In the new file, line 2 is line 1 of
original file, line 3 of new file is line 4 of original file, line 4 of new file is line 3 of original file and
so on. In addition to the output, weightage will be given to program structure, code
optimization, error handling, boundary conditions etc.
Note: You can write the code in Java or Python
Page 10 of 10