Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Assessment for Placement Preparation

Technical Questions (10 Marks)


1. Consider the following array of elements.
〈89,19,50,17,12,15,2,5,7,11,6,9,100〉
The minimum number of interchanges needed to convert it into a max-heap.

2. What is the best time complexity of bubble sort?

3. What is the worst-case running times of Insertion sort, Merge sort, and Quicksort?

4. What is the number of swaps required to sort n elements using selection sort in the
worst case? 

5. Suppose we want to arrange the n numbers stored in an array such that all negative
values occur before all positive ones. What will be the minimum number of
exchanges required in the worst case?

6. Assume that a merge sort algorithm in the worst case takes 30 seconds for an input of
size 64. Which of the following most closely approximates the maximum input size of
a problem that can be solved in 6 minutes?

7. You have an array of n elements. Suppose you implement quicksort by always


choosing the central element of the array as the pivot. What is the tightest upper
bound for the worst case performance can have?

8. What is the output of following program?


#include <stdio.h>
void print(int n, int j)
{
if (j >= n)
return;
if (n-j > 0 && n-j >= j)
printf("%d %dn", j, n-j);
print(n, j+1);
}

int main()
{
int n = 8;
print(n, 1);
}

9. Suppose there are 11 items in sorted order in an array. How many searches are
required on the average, if binary search is employed and all searches are successful
in finding the item?

10. Consider a sorted array of n numbers and a number x. What would be the time
complexity of the best known algorithm to find a triplet with sum equal to x. For
example, arr[] = {1, 5, 10, 15, 20, 30}, x = 40. Then there is a triplet {5, 15, 20} with
sum 40.

Aptitude Reasoning (10 Marks)

1. If AA + BB = ABC, then what is the value of A+B+C=?

a. 15
b. 18
c. 21
d. 12
2. MAC + MAAR = JOCKO, find the value of 3A + 2M + 2C.
a. 31
b. 36
c. 33
d. 38
3. Odometer is to mileage as compass is to
a. speed
b. hiking
c. needle
d. direction

4. Statement: "You are hereby appointed as a programmer with a probation period of one
year and your performance will be reviewed at the end of the period for confirmation." - A
line in an appointment letter.
Assumptions:
I. The performance of an individual generally is not known at the time of appointment
offer.
II. Generally an individual tries to prove his worth in the probation period.
a. Only assumption I is implicit
b. Only assumption II is implicit
c. Either I or II is implicit
d. Neither I nor II is implicit
e. Both I and II are implicit

5. Which of the following numbers must be added to 5678 to give a remainder 35 when
divided by 460? 
a. 980 
b. 618 
c. 955 
d. 797 

6. Four people each roll a four die once. Find the probability that at least two people will
roll the same number? 
a. 13/18 
b. 5/18 
c. None of the above 
d. 1295/1296 
7. A boy entered a shop and bought x number of books for y rupees. When he was about
to leave the bookkeeper said, “if you buy 10 more books, you can have all the books
for 2 rupees and you will also save 80 cents a dozen”. So what are x and y? 
a) (5, 1) 
b) (10, 1) 
c) (15, 1) 
d) Cannot be determined. 

8. Find the greatest power of 143 which can divide 125! exactly.
a) 11
b) 8
c) 9
d) 7

9. Given, log(0.318) = 0.3364 and log(0.317) = 0.3332, find log(0.319)?


a) 0.3396
b) 0.3394
c) 0.3393
d) 0..390

10. A flight takes off at 2 a.m. from a place at 18N 10E and landed at 36N 70W, 10 hours
later. What is the local time of the destination?
a) 6:00 a.m.
b) 6:40 a.m.
c) 7:40 a.m.
d) 7:00 a.m.

Email writing ( 5 marks)


Write an email with a minimum of 70 words to the customer Mr Roy explaining the
delay to the project.

Coding Round (20 Marks)


1. Problem Statement: Given an integer array sorted in non-decreasing order, remove
the duplicates in place such that each unique element appears only once. The
relative order of the elements should be kept the same.

2. Problem statement: Given an array, we have to find the number of occurrences of


each element in the array.

Puzzle (5 marks)
1. What should replace the question marks?

You might also like