Google L5 SWE 2 Phone screening
Company: Google
Role: L5
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
The problem was that the vendor has N number of cars to rent, and he wants to rent those cars.
There are requests for booking the car with a pickup Time, return Time, and ID stored in a list.
The goal is to rent the minimum number of cars possible, assign cars to each request ID, store them in a list, and return it.
e.g.: [[1,6,9],[2,1,5],[3,1,3]]
Answer: The maximum cars he needs to rent is 2 at a time.
Just assign the car number to the ID and return it as a list.
The problem is similar to https://leetcode.com/problems/meeting-rooms-iii/description/
I explained the approach and then coded it. Even after explaining that I'll be sorting by start time, I forgot to write Collections.sort(list,(a,b)->a[0]-b[0]).
I don't know what the feedback could be, but due to less time, I made a huge blunder while writing the code.