Location: B'lore
On: July 2021
Round1:
Q1: Find a number in BST, had to complete the method.
Q2: Maintain top 'K' elements for stream of coming numbers
Extension: Maintain top K percentile for stream of coming numbers
Round2:
Q1: Print next number (num+1) stored in string;
Q2: Implement vector which support lookup, push_back() in O(1). Used unordered_map and array. Unordered_map is to maintain index of array ranges.
Elements are stored in chunks of array of N. Instead of copying existing member on vector extension, get another chunk and update unordered_map.
Round3:
Q1: Find least common ancestor of n-ary tree. LCA of root and child is none. Tree is analogous of organization hierarchy and objective is to find first common manager. So there would be n common manager for root and any child (unlike definition of LCA).
Q2: Suppose N servers are connected with each other and running on version 1. What would be the strategy to upgrade all the servers to version 2?
Round 4:
Q1: Design a library/module to maintain browser history. Can be used this module for every tab of browser.