Google L5 SWE 2 Phone screening

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-11-05Added By Anonymous
Source: Link

The problem was tha vendor has N number of cars to rent and he wants rent those cars.

there are request for booking the car with pickup Time, return Time and id stored in a list.

need to rent minimum number of cars as possible and assing cars to each request id and store in list and return it.


eg:- [[1,6,9],[2,1,5],[3,1,3]]

ans :- max cars he need to rent is 2 at a time


and just assign the car num to the id and return as a list.

problem is similar to https://leetcode.com/problems/meeting-rooms-iii/description/


explained the approach and then code it and even after explaining that ill be sorting by start time i forgot to write the Collections.sort(list,(a,b)->a[0]-b[0])

dont know what could be the feedback but due to less time in hand made a huge blunder while writing the code.

Comments