[Pinterest] - phone screen
Replies (4)
that feedback sounds like a solid pass
fingers crossed the strong explanation secures the onsite
staying calm and explaining the approach definitely helps
can you share the follow up?
# Given a set of calls in time, calculate which elevator will take the last call # - Elevators take 1 second to travel a floor # - You can picture time as a line of natural numbers in the unit of seconds such as 1, 2, 3... # - For simplicity, you can assume: # - all elevators start with a status of "idle" # - elevators don't accelerate or brake, they either go at a speed of # 1 floor per second or they are idle # Example: # elevator: [currentFloor: int, state: enum[up, down, idle]] # call: [originFloor: int, direction: enum[up, down], # destinationFloor: int, timeCalled: int] # callElevatorWithTime(elevator[], call[]): int