Round 1: They had conducted a written round.It consisted of 3 questions(1-1.5 hr time was given).
1.Print spiral view of the binary tree.(It was mentioned to write the optimized code)
2.Build a dictionary for given words(Use Trie data structure).Also they told to write the methods which you think there can be for a dictionary implementation.I had wrote two functions one for insertion of word and another function which could return true if the given word is present in the dictionary else it would return false.
3.It was based on the implementation of the 2nd question.They had given a 2-D character matrix and the output should consist of all the valid words (which were added in the dictionary) from the matrix(from a point you can traverse upwards, downwards, left side, right side).
It is advisable that you mention the Space and Time Complexity for your algorithm.
Around 12 people were shortlisted for FTF interviews.
Round 2: There were 2 coding questions asked and one on building DBMS schema and one SQL query.
The coding questions were:-
- Find first repeating element from the given array in O(n) time and O(1) space.The elements were in the range from 1 to n.
- LRU implementation(Use DLL and HashMap)
- Given a sorted array of integers say {1, 2, 5, 6, 9, 10, 13, 15}, element x(say 10) and another integer n(say 3).So we had to return the n closest integer to x from the given array. Output:-9, 10, 13 (Use binary search and then use 2 pointer technique.)
- Given m tax slabs and for each slab there was a specific tax percentage applicable.So you are given an array of salaries, Hence you need to return the total tax applicable for each salary in the given array.