The recriuter reached out to me through linkedIn.
YEO: 5
Both rounds were coding rounds scheduled over Zoom
1st Round
The interviewer was extremely friendly. He asked me to calm myself down, and can go grab coffee/tea if I want. Only one question was asked. Interviewer told me that he is not expecting answer or most optimized answer, but will look at my approach. I missed optimization part of not putting cell in grid if we have reached it with bigger value of K.
shortest-path-in-a-grid-with-obstacles-elimination
2nd Round
Given continous input stream of data
User City Event Timestamp
user1 Blgr RIDE_REQUESTED timestamp1
user2 Blgr RIDE_REQUESTED timestamp3
user1 Blgr RIDE_CANCELLED timestamp2
user1 Blgr COMPLETED timestamp4
The input stream is not ordered based on timestamp, as in an event occuring later can come first. You have to put this in a data structure to support timestamp based queries, like Give list of RIDE_REQUESTED for bglr city from [timestamp1,.. timestamp5]
Solutions discussed:
- I suggested to use ordered map, but the interviewer said that data is too much, and insertion in ordered map will take logn which is not feasible
- Next i suggested to use unordered map and use a for loop to run on timestamps. He rejected this saying, if range asked is 1 to 1000 timestamp and there are very few enteries for this timestamp, than your for loop will be inefficient
- After this I discussed B+ Tree, segment tree, using Array's index and doing binary search over it.
- In end he asked me to implement Segment tree, which i was not confident of from implementation prespective, so implemented unordered_map solution.
Throughout interview, the interviewer kept suggesting me to use basic data structures and think what STL library actually use to implement Map. I really enjoyed this round cause of the discussion that happened and how good the interviewer was quickly grasping whatever solution I was suggesting.


