Phone:
Classic elevator question.
Q1: Given n elevators, all starting on floor 1. Then there's a sequence of calls; return which elevator the last call ends up assigned to. You can assume each call finishes before the next one starts.
Follow-up: Given elevators with random starting positions, again a sequence of calls; return which elevator the last call is assigned to. This time, when each call comes in, an elevator might still be in the middle of executing a previous call. The solution is to update each elevator's state every time a new call comes in, then decide which one can take the ride.
Onsite:
Coding 1: similar to 1055
Coding 2: similar to 815
System Design 1: also a popular question that's been shared online before — merchants can update a product's attributes individually or in batch, and can upload images too
System Design 2: design a system that lets you update a merchant's address, number of followers on social media (like Instagram, Facebook, TikTok...), start year, and country (pulled from their Wikipedia page) at any time
Behavioral
I was notified yesterday that I passed; next up is team matching. Hoping a team picks me up!
Discussion
Loading comments…