Low Level Design of Elevator with @gkcs - Mock System Design Interview

preview_player
Показать описание
How do you think I did in my first system design interview? Also Gaurav is just so nice, supportive and chill! I guess you can notice I had great time giving the interview, this is how software interviews are supposed to be - fun and worth remembering!

You can get 𝐃𝐈𝐒𝐂𝐎𝐔𝐍𝐓𝐒 using code "KEERTI" -

You can also connect with me on-

The video has following parts-
0:00 Intro
0:40 Problem Statement
2:18 Requirement listing
13:22 Object states and behaviours
21:24 Algorithm
25:05 Nested Map problem
28:51 Types of requests
35:16 APIs
37:35 Request Handling with Event Bus
42:55 End to end flow
43:20 Removing redundant classes
48:04 Evaluation and verdict

#GauravSen #MockInterview #SystemDesign
Рекомендации по теме
Комментарии
Автор

I think she asked many questions related to elevator design which werent needed. She was unnecessary wanting to make system too complicated by asking questions like service lift and all.
System design what I see is starting with simplicity and then including complexity.
As usual Gaurav sen was too good

arunavkhare
Автор

I came here for couple of reasons:
1. I wanted to see what kind of design pattern could be used here. There was no discussion about any design pattern.
2. Working code: I wanted to see the code implementation, like use of concurrency or some other smart way. With the size of video I thought there will be actual code.

abhijeetkumar
Автор

Usually Interviewers are not that helpful as Gaurav was. The SD interviewers I have faced look at their clock and will tell me to wrap stuff quickly every 5 - 10 mins. Things like current weight of lift and max weight limit should be in the block diagram as well which are not that difficult to think of. Overall still I appreciate the content provided. It was truly unique and really made us think

anonymousgod
Автор

That was Really great Design interview.
had few comments...
it was a simple design and questions were a bit more...
* why do we need 2 hash maps, there is no random value and floors are fixed, can use a vector or array but thats also not required
* instead can use 2 priority list, for up and down and a flag for direction, in one direction complete the queue and move on to the other based on the flag and mediator and person will request to append to the priority queue.
* its mediator design pattern problem, no need of 3 classes, a mediator will manage the number of lifts and its access
* I guess if we keep the class simple and decoupled, it would be good

KiranKumar-emqy
Автор

A lot of the discussion was unnecessary. Also, it is already recommended to write down thoughts which Keerti was not doing. It felt more like a pep talk.

gauravganna
Автор

Some quick thoughts:
1. We can use a boolean array as well for storing which floor to stop at. Though due to less number of floors/lifts, either approach should be fine.
2. There are cons of storing the hashmap of which floors to stop at, in the lift class. Hence it makes sense to store it in a common place, so that all lifts can simultaneously access the shared information and hence the first lift querying for the current floor to open at, thus serving the user as fast as possible.
3. There was a discussion around multiple directions but LEFT and RIGHT don't seem to make sense for a Lift since usually LIFTs move in vertical direction.

Good discussion though. Thanks for your videos, Keerti.

karankapr
Автор

One thing we can do is maintain a priority queue inside very Lift Object and on every request we can add the source floor at first and after getting in the lift another req will put in the destination floor in the queue and the lift will move according to the queue.

TheHimu
Автор

GKCS god of system design....Nice Collab and will get more idea on how system design problem should be approached.

ankitraj
Автор

Good work Keerti and Gaurav,

Another easy solution, which you might like is

Let's consider 3 important entity of this design .
-- request notebook -- which will keep all the floor request in a queue for processing further .

-- schedular -- most important component, which will take care of all relative business logic of serving requests to elevators .

-- elevator - which will be having two priority queue, up and down , current state and direction .

Now schedular is keep processing the notebook queue with relative states of elevators and initiating or filling there serving queue.

sandeepg
Автор

I know this is a serious, well-thought video but Gaurav's expression at 0:13 is just too good to ignore

chinmay
Автор

They have started asking these types of questions for freshers too nowadays

vrashankraom
Автор

The first system design interview I watched Keerti is very particular about the design decisions made.. lol... was fun to watch.... And thanks for taking the interviewee's role this time.

joed
Автор

Can we think of this like a locking system where the resources are lifts available and we lock the lift if it is in moving and release the lock on it after completing the trip? Something like a semaphore/re-entrant locks we can think of. We can also use some sort of asynchronous mechanism like a queue to store the requests and and serve them.

hamsalekhavenkatesh
Автор

Love Gaurav's expressions .... very humble dude

bluesteel
Автор

"Proper Naming and testing things" are the two important things that take extra effort and are sometimes difficult in Software Engineering 😅😂😐 Just Awesome collab🔥

abhishekvishwakarma
Автор

My first basic question would have been what you want this system to be optimised for? Why there are only 3 elevators? Starting with 3 means that someone has already started the design, what's the thought process behind starting with 3. Just abstract?

viky
Автор

She is thinking out loud and almost got all the use cases including very corner case as well. Excellent

Itsmenly
Автор

What pattern is used for elevator system ?

parnamondal
Автор

Nice content from both system design techies and experts keep going, this brings lot of learning room to public about such simple systems which become complex in their designs 😊👌👌👌

praveenchouhan
Автор

Doesn't it make more sense to add the request made by the user once inside the lift as a part of a vector of stop destinations which inturn would be a member variable of the lift class, this way we can be assured what lift has to be stopped at what floor

adityagitte