Round 1: System Coding
https://leetcode.com/problems/snapshot-array/description/
Round 2: System Coding
There are N worker nodes, and we need to write apis:
runTask() -> Runs a particular task on a node
AddTask(nodeid, taskid) -> Adds a task to a particular node nodeid
rebalanceTask() -> Moves tasks from one node to another if some node has lots of cpu intensive tasks.
printTask() -> Prints the list of tasks in queue at each node.
To Add a task to a queue we can maintain a per node task_queue.
I did rebalancing based on the number of tasks that are currently pending in each node's queue to maintain the invariant that each node has atmax (sum of all the pending tasks in each node's queue)/total_number_of_nodes number of tasks at a moment.
Round 3: DS & Algo
You are given a stream of person's strength(integers) you need to find out rank of current person in the stream(moving from left to right). We can assume stream can be stored in RAM.
Eg. stream: [5, 4, 6, 1]
Output: [1, 2, 1, 4]
At t=0 only 5 is there so its rank is 1 as it is the highest strength
At t=1, [5,4] are there and rank of 4 is 2 as it is the second highest strength
At t=2 [5,4,6] are there and rank of 6 is 1 as it is the highest strength
It can be solved using Binary search trees. We need to insert strength at each point and find all the elements greater than the current element from the tree. Storing number of elements to the right of each BST node will help reduce the timecomplexity as we don't have to traverse to the right of the node.
Interviewer wanted to implement Binary search trees instead of using the stl library set function.
Round 4: System Design HLD & LLD mix
Design a scalable and fault-tolerant data collection system that can collect logs and data from various sources (eg, application servers, tailing a file etc.) and route them to different destinations (e.g., Elasticsearch, Kafka, S3) for further processing and analysis.
The design round was very vague and interviewer didn't seem interested in contributing to discussion and providing any comments on the design. Didn't go well for me.
Round 5: Hiring Manager
Didn't happened for me as i got rejected in Round 4
Overall it was a good experience. Recruiter donot responds to my request for getting feedback on individual rounds which is sad as i had invested a lot of time in preparing/giving the interviews.