Microsoft || SWE || Round2 - LLD Round

Anonymous User
2421
Dec 16, 2024

B.Tech. from Teir1
YOE: 1.5 years
Current Company: Fintech( MNC )

Microsoft Round 2:
Elevator LLD Problem:

A building with 50 floors. You have a lift which can take 20 people at a go. The lift can stop at any number of floors but for any person who is being served by the lift has to reach from entry floor to destination floor within 5 stops. A lift will serve a new request only if it can maintain the rule of 5 stops for people who are already in the lift and also for the person sending the request.

This is an example case A,B,C,D,E,F are deonting persons and corresponding values are src and dest floors.
A 0 10
B 1 9
C 1 8
D 1 7
E 1 5
F 7 10

For this case, if Person A is entering at level 0 then elevator can stop at 1 and it can server Person B,C,D and also to person F. As from going level 0 to 10, it will stop at maximum 5 places till reaching level 10( floors on which it will stop will be 1,7,8,9,10.

this is the problem which i faced in my Microsoft lld round interview.
Mainly discussion was around the algorithm for the given constraint like elevator should not stop more than 5 stops while serving one person.
And currently consider only one lift in one building.

which data structure and which optimal strategy you will use to solve this problem.
any thoughts??

Comments (5)