Round 1: Coding test (Roughly 300 participants)
The Coding test comprised of 5 MCQ's and 3 coding questions and had a total duration of two hours.
The MCQs were mostly related to finding time complexities of given code snippets
The Coding round was as follows:
- Given an array representing the height of a set of a series of walls of unit thickness. Find the pair of walls that can hold the maximum amount of water between them when the walls between them are destroyed and filled with water. (50 marks)
Hint: 2 iterators from the front and back. - Given a matrix of size NxN and an integer K. Find the minimum sum of all the elements of every sub-matrix provided the ability to decrease the value of any elements within the matrix at most K times. (50 marks)
- Given a search history of a particular user in the form of a list of URLs find their respective ranks in terms of most visited. If 2 websites have been visited the same amount of time then rank them lexicographically. (20 marks)
Hint: Use hashmaps with key as URL and value as the number of visits.
- Sort a given array of 1's and 0's.
- Find the top view of a given tree.
- Find sub-array whose sum adds up to a given value.
- array comprised of only positive integers.
- array comprised of negative integers as well
- List all the data structures used in constructing a page table with LRU swapping algorithm.
- Print the zig-zag order traversal of a tree.
- Write a runnable code of constructing a tree given in-order and post-order traversal.
- Write a runnable code of constructing a tree given zig-zag order and post-order.
- Make the aforementioned codes more robust (handle extreme cases).
- Later he asked briefly about my projects and publications.
- Given a circle of integer radius R and center at origin. Find all the integer coordinates on the circumference without using floating-point operations.
Hint: find Pythagoras triplets X^2+Y^2=R^2 while remembering the respective values of X and Y)