Parking lot occupancy peaks from entry and exit events

0
Remix

You get parking events [car_id, time, 'entry' | 'exit'], not necessarily in order.

  1. What is the largest number of cars that were in the lot at the same time?
  2. Return the time interval during which the lot held that many cars.
  3. The exit scanner is faulty and some exits were never recorded. Every car stays at most 2 hours, so a car with no exit is gone 2 hours after it entered. Answer part 2 again.
AmazonTechnical phone screenLast asked Dec 2025
No answer yet. Write the first one; the best answer gets endorsed.