0% found this document useful (0 votes)
92 views7 pages

Elastic Run 2018

The document contains 20 questions from aptitude and technical categories. Some questions are multiple choice while others require writing code or formulas. The questions cover topics like series, probability, arrays, linked lists, recursion, sorting, hashing, and time complexity analysis.

Uploaded by

Omkar Sonmale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views7 pages

Elastic Run 2018

The document contains 20 questions from aptitude and technical categories. Some questions are multiple choice while others require writing code or formulas. The questions cover topics like series, probability, arrays, linked lists, recursion, sorting, hashing, and time complexity analysis.

Uploaded by

Omkar Sonmale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Elastic run & Blazeclan Campuse

Aptitude
1. Out of 150 faculty members, 55 are connected through Facebook, 85
through WhatsApp & 30 are not using social media. Find the number of
faculty members connected via Facebook only.

2. Find the next term of the series:


8, 7, 11, 12, 14, 17, 22, ___

3. For a test a student scores 130 marks. There were total 60 questions. 4
marks for every correct answer & 1 mark less for each wrong answer. Find
the total answers the student marked correctly.

4. A divisor of 242 leaves a remainder 8, the same divisor with 698 gives a
remainder 9. The addition of these numbers gives a remainder 4. Find the
divisor.

5. Fan: Wings:: Wheel : ?

6. In a race of 100m, A finishes the race in 36sec, B in 45sec. The distance by


which A finishes the race ahead of B in meters is ________

7. FRIEND : HUMJTK:: CANDLE: ?

8. 2, 3, 6, 11, 18, 25, 38. Find the wrong term of the series
Technical
A. Write a program to Swap 2 numbers without using a third variable
by multiplication & division.

B. How many Queues are required to implement stack if no other


data structure like array or linked list is not available.

C. Write a program to reverse single linked list

D. Write a program to print Fibonacci series using recursion

E. Write a program to convert uppercase to lowercase & vice-versa


without using inbuilt functions.

F. What is the advantage of increased RAM?


a. Virtual memory increases
b. Larger RAM implies greater speed
c. Page faults are reduced
d. Segmentation faults are reduced

G. Write a single line C statement to find if a number is power of 2.

H. Write a formula to add odd number divisible by 3.

I. Write a program to find maximum of two numbers without using


loop or condition.

J. What is singleton class? How to make a class singleton.


K. Write a program for reversal of a string without using inbuilt
function

L. Difference between IN & EXISTS when used with WHERE. Which


performs better.

M. int function (int n)


{
if (n = = 4)
print n
else
return 2 * f (n + 1)
}
void main()
{
printf(“%d”,fun(2));
}

Output of the code


a. 4 b. 16
c. 8 d. Compilation error
N. Stack it
There are N types of books & an array A. Each element of that
array i.e. A[i] denotes number of books in each type. All books of
all types are of equal thickness. The books have to be stacked in
such a manner that each stack has one specific kind of book & an
equal number of those books.
Write a program to print the maximum number of books
that can be placed in each stack that each stack has the same
height & same kind of book.
Input format:
 First line: N
 Second line: N space-separated integers (denoting books of
each type)
Output format:
Print the maximum number of books in each stack such that each
stack will have the same height.
Constraints
1 ≤ N ≤ 10
1 ≤ A [i]≤100000

Sample Input
3
84 90 120
Sample Output
6
Explanation:
14 stacks of type a[0], 15 stacks of type a[1], 20 stacks of type a[2]
each having 6 books.
Note: Your code should be able to convert the sample input into
the sample output. However, this is not enough to pass the
challenge because the code will be run on multiple test cases.
Therefore , your code must solve this problem statement.
O. HashMaps
You have to implement the functionality of HashMaps using a
linked list. You are given, N(Key, Value) pairs that are to be
inserted into the HashMap.
The linked list should not contain any duplicate keys, it must
follow all the properties of a HashMap along with maintaining the
order of insertion of elements.

Write a program to implement the functionality of a HashMap


using a linked list by inserting the (key, Value) pairs in order.

Note:
It is important that you neither insert a key that is already present
in a HashMap nor override the value present at that key.

Input format:
 First line: N
 Next N lines: Space-separated string S & integer val
(denoting the (Key, Value) pairs)
Output format:
Print the (Key, Value) pair separated by space.
Constraints
1 ≤ N ≤ 105
5
1 ≤ Key .Val ≤10

Sample Input Sample Output

5 Zees 4
Zees 4 Ani 6
Ani 6 Lun 10
Ani 8 Rag 20
Lun 10
Rag 20

Explanation
All the keys should be displayed only once in the order in which they
were inserted & the value at a key will not be overridden if it was
already present in the Map
Note: Your code should be able to convert the sample input into the
sample output. However, this is not enough to pass the challenge
because the code will be run on multiple test cases. Therefore , your
code must solve this problem statement.
P. Which one of the following is the tightest upper bound that
represents the time complexity of inserting an object into a binary
search tree?
a. O(1) b. O(n)
c. O(n log n) d. O(log n)
Q. You have an array of n elements. Suppose you implement quick
sort by always choosing the central element of the array as the
pivot.Then tightest upper bound for the worst case performance
is
a. O(n3) b. O(n2)

c. O(n log n) d. O(log n)

R. Consider a hash table with 9 slots. The hash function is h(k)=k


mod 9. The collisions are resolved by chaining. The following 9
keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17. 10 The
maximum, minimum, and average chain lengths in the hash table,
respectively, are
a. 3, 0 & 1 b. 3, 3 & 3
c. 4, 0 & 1 d. 3, 0 & 2

S. The minimum number of arithmetic operations required to


evaluate the polynomial P(X) = X5 - 4X3 + 6X + 5 for a grven value
of X using only one temporary variable.
a. 6 b. 7
c. 8 d. 9

T. Consider the following Pseudo code. What Is the total number of


Multiplications to be performed?
a. ½ product of the 3 consecutive integers
b. 1/3 product of the 3 consecutive integer
c. 1/6 product of the 3 consecutive integers
d. None of the above

You might also like