There were 2 coding questions and I also had to explain the approach and time complexity in another section.
Given a list of coordinates(x and y) of restaurants in the area, find X nearest restaurants(to origin) and return a vector containing their coordinates.
Given a 2D grid containing 1's, 0's and 9, find the shortest distance between (0,0) and the position that has value 9. 0's are obstacles and we can move horizontally as well as vertically.For first question i used a priority queue of pairs where pair.first was the distance and second was the index. Time complexity for this is O(N + Xlog(N)) where N is number of points.
For 2nd i used bfs and i returned the distance when i encountered the value 9. If i didnt encounter it that means its unreachable and i returned -1. Complexity is O(N * M) where N is number of rows and M is number of columns.
I was able to pass all the test cases in both the questions.
There was also a work style assessment where you are asked behavioural questions.