Elastic Run 2018
Elastic Run 2018
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.
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.
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.
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.
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
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)