I was watched different LLD lectures and felt like it is a difficult subject. But after seeing your lectures, it has become so easy to solve LLD questions
Boy, you recorded this video at 4 AM!! Still so much energy. Congratulations on making such a worthy content. A small thing, decorator is bit overkill or misplaced one, visitor could have been bit appropriate as you are not attaching any special responsibility to classes while decorating (purist's opinion :) ). None the less, great content. One more thing, can you create GITHUB project with it (let it be half complete), people can fork and have skeleton implemented OR can submit PRs. Looking forward!
Great video but a few queries. 1. Why are we not using inheritance to represent rooms and using enums for this? Uncle bob strongly suggests against this. 2. Why are we not using the state design pattern for dealing with states and using enums for this again? The state design pattern is designed for this purpose.
Hello Soumyajit. This is the best explanation on RUclips. One suggestion: you left out one enumeration BookingStatus public enum BookingStatus { REQUESTED, PENDING, CONFIRMED, CANCELLED } Apart from that, everything is fine.
Hi. Good content. I have just one feedback, while stating a pattern, can you also explain 2-3 minutes about that pattern ( and probably help see where to use which pattern ) assuming not everyone is aware of the design patterns.
@@SoumyajitBhattacharyay Yep. that would be great. Also can you tell what is the use of class RoomCharge? We are just implement the BaseRoomCharge Interface . how do we plan to use RoomCharge?
To add a decorator pattern for Room charges, We have to create room charges first and then decorate with InRoom charges and then Room Service charge, I believe we should create a builder pattern to build these charges. The receptionist should call Builder to build the room charges and that builder will instantiate all the charges and decorators and return a result to the receptionist. The decorator pattern first create an abstract class from the base interface or abstract class and then the concrete decorators should implement the newly created abstract class. I think they should not directly get the BaseRoomCharge otherwise it is just an Inheritance.
We use Builder pattern when we want setters for every data member, so that we can customize. As you suggested if we use builder for room charges, there will be only one property to be set, which is baseRoomCharge, because we are using Decorator for InRoom Charges and RoomService Charges. So Applying Builder just to set baseRoomCharge will look like unnecessary, what you guys think?
Agree with Saurabh on the Decorator pattern part. We should not let each decorator have a member of base charge. Instead create an abstract class that holds baseCharge and each concrete decorate should extend it. Eg : abstract class RoomExtraCharges implements BaseRoomCharge { BaseRoomCharge baseRoomCharge; } class InRoomPurchaseCharges extends RoomExtraCharges { double cost; Double getCost() { return cost + baseRoomCharge.getCost(); } }
1.Why do you implemented different charges by different object.If we just need to add costs,then we can have some variables corresponding to each type of service in RoomBooking class.I think we can have some class like Service and its subclasses like RoomRentService,KitchenService,LAundry Service and then RoomBooking can have List and total bill amount which makes more sense to me.let me know your thoughts. 2.Assigning of RoomKey to Room ,shall this be in Room Class with and API as assignkey(RoomKey) as opposed to what you proposed like addingin RoomKey with API as assignKey(Room)?Which one is more accurate and why? uest 3.I think receptionist should extend Person as receptionist can also do all operations that a person can do? 4. In Booking class, the createBooking should take Guest,RoomBooking instead of only Guest?Because it is called only when guest has all the data for Booking is available,means a guest wants to book these rooms for these much days.If we pass only Guest info ,how does it knows other details?
Sure will take that into consideration!. Booking anf searching can be implemented as a class and an interface as well. It completely depends on whether or not we have a use case of exposing only certain methods to otger services and not giving them explicit access to all the internal protected methods. For a sime use case of an LLD, we can only implement them as a class. Otherwise, you can create an interface and then implement the methods in a separate class. Either ways is good!
Awesome Video! Explained in simple terms. Have a doubt In Guest class you have the functions getAllRoomBookings() createBooking() cancelBooking() (in the code provided in the description), the Receptionist class also needs this functionality , how can we share this functionality?
very well explained indeed. I had one doubt though why are you keeping the search related information for Guest and Receptionist ?? where do you think you can utilize that ??
Great video, was just wondering if in the decorator pattern the cost addition would be better in the individual decorator constructors to avoid making the getCost method to add to the original cost
I’m not sure if I missed something but I believe the part as to how a room would be saved against a date. That is how do we save that a room is booked for certain dates and available for certain dates. Moreover, how would we be storing it in db as well? I found this to be missed in another hotel booking lld as well.
Thank you for this content. I have a very naive question here.....BaseRoomCharge is an interface so how come we are instating an object for the interface in RoomService and RooomCharge class?
we are just using reference of interface BaseRoomCharge. in reality the object will be of RoomCharge. we will be initializing BaseRoomCharge variable to an object by passing the same in constructor.
Thank you for explanation. Small doubt I have is, for createBooking method, we are sending only guestInfo, but how will we know the room info to book? Shouldn't we be sending the room info also?
@Soumyajit Bhattacharya , thanks for the awesome content, but I have one doubt , why can't we keep add addRoomKey method in Room class , instead of keeping assignRoom method in RoomKey class. what is the advantage of the approach discussed in the video, and what is the demerit in what I asked. Thanks a ton, please revert back with an answer 🙏
HI, can you make a video on Solution Design for things like total booking amount calculation and stuff? I'm having a hard time understanding what to do with a solution design,
Thanks so much for the feedback! Really appreciate it!! Stay tuned as I will be uploading more such LLD videos, interview experiences and mock interview videos as well!
I have alow level design playlist that you can go through! There are many more design problems that i have solved. Many more i am solving and will be uploading one after the other!
@@SoumyajitBhattacharyay will be waiting for upcoming video. And I saw other videos of lld as well. They are very nice. Finally a one stop channel.keep up the good work
I believe Person can be made an Interface or Fully Abstract class as it does not share code between two sub-classes. Also, multiple interfaces can be implemented by a sub-class, and hence a sub-class like Guest can implement Person and SearchFunctionality, BookingFunctionality all at the same time. class Guest implements Person, SearchFuncitonality, BookingFunctionality{ ... } Please guide me if I m in the wrong direction. Thank you. Great concise content but you can make it much better by more detailed discussions.
Hi Soumyajit, quick question... why did you use an Integer type for the 'id' of your hotel, but a primitive int type as your zip/pin for your location?
First of all thanks for these great content! I have query,currently i am in final year and I do know OOPs but all these stuff is overwhelming for me.Can you share some resource I can refer for better understanding? Also,as a fresher how much knowledge of OOD and system design is expected in interviews for companies like amazon?Thanks again.
Thanks, for the kind words. As a fresher at least a basic knowledge of OOD design is expected. No knowledge of System design is expected at all. Apart from this, I will be collating the resources and sharing them. Apart from this, I will also start a video series on design patterns basics. Make sure to watch that a well. Do subscribe and share it among your friends!
@@SoumyajitBhattacharyay Video is really helpful for Preparing for interviews. But wondering how Housekeeper will have access to all room objects, in order to return a list serviced by him
Usually in production system I haven’t seen any CancelObj, SearchObj being stored. APIs are exposed for search room functionality and either of the actor can access it
Why you are putting roomstyle as enum?. If we are going to add one more roomstyle then we need to alter the roomstyle enum in that case it violates open close design principle. Instead of enum we can create roomstyle as subclass.
Last two classes implementing BaseRoomCharge are incomplete. You need to assign an instance to the member baseRoomCharge. Also, define the set method to set the cost of the child classes.
hey i have generally not defined any setters or getters. otherwise it becones too big. setters and getters are not expected to be implemented in an Interview setting.
Why do you say that search api should be in guest/receptionist class? user.search(abc_hotel) ...does it make sense? How can searching hotel be a property of user class? Shouldnt it be oyo.search(abc_hotel) ...? Because oyo(our hotel mgmt class onject) conatins all the data abt hotels so this object is supposed to have the search api.....
Great explanation, It would be great if you include class relationships like associations, decompositions, etc. Also one doubt I have is how you decided that person class would be an abstract class also room charge as interface?
well, abstract class is more of generalization, i mean the common method is used by other class therefore we used person as abstract class. But interfaces are more of standardization where you can put abstract method that has to be implemented according to the use case. So getCost method has different implementation in different classes as you can see.
Have a doubt here. Room is part of Hotel class, which is fine. But why RoomStatus is part of Room class? A room will have different status on different days. Am I missing something or is it done wrong here?
Hi All. When we talk about the Hotel management system. what situation do we need to consider? 1. it's a stand-alone application running at a particular hotel location and user can make booking from hotel location only. 2. It's a stand-alone application for particular hotel, but user can do booking from remote location as well (we may need to deal with concurrency). 3. Similar to hotel booking service from 'make my trip' like applicatons
Why not have the book and cancel methods defined in the room class. Since, room is the object on which these actions need to be performed. Also, could move the searchRoom method to the hotel class.
Hi, It was done so that the guest who will be staying in the hotel is able to see all the booking detail of all the rooms that the guest has done. If you have booked anything, generally systems allow you to see all the items that you have booked, all the times you have ordered from an online e commerce platform, all the tickets you have ordered from an online ticketing system etc.
Great video but still not getting what is the use of assignRoom API in roomkey class could someone give me an explanation? I think it should be in Room class itself
No. It all depends on what kind of key we are talking about. Here, I had made thinking a key card, which can be programmed to unlock any room. Hence the function in the key class ❤️
this approach of the designing system looks a bit odd to me as in actuality we make APIs, controllers, etc, and the entities(guest, admin, etc) are represented as models, generally, the models don't have any(which perform some heavy actions as mentioned here in the video) methods inside them rather the service class have these methods. For example, for adding/deleting a room we can have APIs to add and delete a room respectively and the controller methods can call service like "RoomManagementService" which can add/delete a room to/from inventory(db). @Soumyajit Please let me know what do you think about this? In what way should one approach the problem?
Try to think about that object how should it ideally behave in real world. For example : You know about Hotel , how they operate. Then just try to think about the actors and their actions. Proceed slowly.
Ok so where is your decorator class i mean you just made an interface and extended it, I agree you are using definition of decorator pattern but not actually the decorator pattern
I think so i had answered it in one of the comments. But on a high level, these can be done in myriad of ways. Completely depending on how we implement the underlying database and corresponding access to it. There is something known as optimistic locking, which we can take use of to lock access to a particular row in our database while it is being read till it has been written or the operation times out.
It depends from one interviewer to another. Ideally LLD is not about implementation. LLD comprise of db design api design and class structure design. Even in the LLD that we do in the products/services that we build we do it. Implementation is different than LLD. How ever some interviewers might ask to implement some of the functions as well.
@@SoumyajitBhattacharyay thank you for responding. Did not expect that. So I am preparing for this company and they ask a question “Design a hotel system with these features...” basically almost similar to the features you have. But they ask this in the machine coding round, I think in machine coding round they would want the full fledged system. Is my assumption correct? Also, do they not expect us to use a database since your solution (even though brilliant) does not store any data persistently ?
Yes that is correvt. Generally these rounds are expected to be vompletely in memory. That is something that is a bit difficult to grasp first up. While doing machine coding round, yes a solution is expected. So you might have to implement the methods. But the time given for that is usually more somewhere around 1.5 to 2 hrs at least
I don't know why you were in a hurry in the end, but you should have spent more time on the last topics rather than explaining basic classes and inheritance concepts.
If we go via SOLID principles, is getting rooms serviced responsibility of HouseKeeper class ? I think No as the list would be needed to be fetched from a data store and a person class going to a data store via a Dao class isn't a correct design. Nowt the question is that who will provide this information ? To answer this, first we need to know who needs this information ? It must be admin or a receptionist as they might face a situation where they might need to have this information. So will they ask housekeeper ? No. There should be a Dao class which can provide this information directly. Housekeeper may be the source of truth but that truth has been logged into data store. Job of housekeeper is to do house keeping and enter corresponding logs. Instead housekeeping class should expose a function as : public void serveRequest(Room room, ServiceType serviceType);
1.i think it will it will just inform DAO to get me result,it will not have code to actaully connect to data store.And this does not violate Single responsibility principle.if we see a library system, a use should be able to reserve a book,so there is an api in user to reserverBook, it will ask data layer or some reservation service to do booking,so talking to external layers does not voilate SRP.otherwise it will be just a pojo object?Let me know your thoughts 2.housekeepr should have api to addHouseKeeping Logs given a room.That i agree with you. these are good doubts u raised. thanks
Hi @soumyajit : I have a doubt in drive.google.com/file/d/1GFDk4DBOtefSbuUioAQ5D3T2-cH9m47l/view . (1) What is the use of RoomCharge class (2) In RoomServiceCharge class, don't understand baseRoomCharge.setCost(baseRoomCharge.getCost() + cost); BECAUSE (a) baseRoomCharge doesn't have setCost (b) baseRoomCharge doesn't have cost field. Please help. I am preparing for SD LLD in Java and making your videos as base.
I was watched different LLD lectures and felt like it is a difficult subject. But after seeing your lectures, it has become so easy to solve LLD questions
That is absolutely amazing to hear! 😛
Same with me
Thank you for explaining LLD in simple words. The most detailed and understable low level design video I have ever came across!
Boy, you recorded this video at 4 AM!! Still so much energy. Congratulations on making such a worthy content.
A small thing, decorator is bit overkill or misplaced one, visitor could have been bit appropriate as you are not attaching any special responsibility to classes while decorating (purist's opinion :) ).
None the less, great content.
One more thing, can you create GITHUB project with it (let it be half complete), people can fork and have skeleton implemented OR can submit PRs.
Looking forward!
Yes thats a great suggestion. I will surely create a github project as well!!
Great video but a few queries.
1. Why are we not using inheritance to represent rooms and using enums for this? Uncle bob strongly suggests against this.
2. Why are we not using the state design pattern for dealing with states and using enums for this again? The state design pattern is designed for this purpose.
Best video on LLD so far better than paid websites. please include class diagram in LLD as well.
Hello Soumyajit.
This is the best explanation on RUclips. One suggestion: you left out one enumeration BookingStatus
public enum BookingStatus {
REQUESTED, PENDING, CONFIRMED, CANCELLED
}
Apart from that, everything is fine.
Hi. Good content. I have just one feedback, while stating a pattern, can you also explain 2-3 minutes about that pattern ( and probably help see where to use which pattern ) assuming not everyone is aware of the design patterns.
that is a great feedback. i am thinking of starting a video series explaining commonly used pattern along with example. whats say??
@@SoumyajitBhattacharyay Yep. that would be great.
Also can you tell what is the use of class RoomCharge? We are just implement the BaseRoomCharge Interface . how do we plan to use RoomCharge?
@@SoumyajitBhattacharyay Please do it
@@SoumyajitBhattacharyay Sure
Superb explanation!! Honestly, I went through some of the LLD videos but this is the one which I like the most. Thanks!!
To add a decorator pattern for Room charges, We have to create room charges first and then decorate with InRoom charges and then Room Service charge, I believe we should create a builder pattern to build these charges. The receptionist should call Builder to build the room charges and that builder will instantiate all the charges and decorators and return a result to the receptionist. The decorator pattern first create an abstract class from the base interface or abstract class and then the concrete decorators should implement the newly created abstract class. I think they should not directly get the BaseRoomCharge otherwise it is just an Inheritance.
We use Builder pattern when we want setters for every data member, so that we can customize. As you suggested if we use builder for room charges, there will be only one property to be set, which is baseRoomCharge, because we are using Decorator for InRoom Charges and RoomService Charges. So Applying Builder just to set baseRoomCharge will look like unnecessary, what you guys think?
Agree with Saurabh on the Decorator pattern part. We should not let each decorator have a member of base charge. Instead create an abstract class that holds baseCharge and each concrete decorate should extend it.
Eg :
abstract class RoomExtraCharges implements BaseRoomCharge
{
BaseRoomCharge baseRoomCharge;
}
class InRoomPurchaseCharges extends RoomExtraCharges
{
double cost;
Double getCost() {
return cost + baseRoomCharge.getCost();
}
}
1.Why do you implemented different charges by different object.If we just need to add costs,then we can have some variables corresponding to each type of service in RoomBooking class.I think we can have some class like Service and its subclasses like RoomRentService,KitchenService,LAundry Service and then RoomBooking can have List and total bill amount which makes more sense to me.let me know your thoughts.
2.Assigning of RoomKey to Room ,shall this be in Room Class with and API as assignkey(RoomKey) as opposed to what you proposed like addingin RoomKey with API as assignKey(Room)?Which one is more accurate and why?
uest
3.I think receptionist should extend Person as receptionist can also do all operations that a person can do?
4. In Booking class, the createBooking should take Guest,RoomBooking instead of only Guest?Because it is called only when guest has all the data for Booking is available,means a guest wants to book these rooms for these much days.If we pass only Guest info ,how does it knows other details?
This is exceptional content!! Simply awesome. Not seen such detailed video before on youtube!!! Simply love this channel!!
Good video. 1) please go slow 2) why booking and searching implement as a class instead of interface.
Sure will take that into consideration!.
Booking anf searching can be implemented as a class and an interface as well. It completely depends on whether or not we have a use case of exposing only certain methods to otger services and not giving them explicit access to all the internal protected methods. For a sime use case of an LLD, we can only implement them as a class. Otherwise, you can create an interface and then implement the methods in a separate class. Either ways is good!
Thank you for explaining LLD. This is best explanation of LLD I have seen. Try to upload videos for other videos such as design a vending machine.
One of the finest video, I have ever seen on LLD. Thanks For uploading.
Thanks for the feedback!. Do stay tuned, i will be uploading lld for stack overflow tomorrow!
Do share it among your friends!
@@SoumyajitBhattacharyay Would love to watch that as well.
The stack overflow LLD video is live!
Do share it among your friends!
@@SoumyajitBhattacharyay Its awesome as well,
Awesome Video! Explained in simple terms.
Have a doubt
In Guest class you have the functions getAllRoomBookings() createBooking() cancelBooking() (in the code provided in the description), the Receptionist class also needs this functionality , how can we share this functionality?
very well explained indeed. I had one doubt though why are you keeping the search related information for Guest and Receptionist ?? where do you think you can utilize that ??
@Soumyajit, Thanks a lot. However small suggestion for all LLD use cases. They all are ignoring 1NF form of the DBs. Avoid having List.
This is what I was looking for. Thank you for this amazing content.
Great video, was just wondering if in the decorator pattern the cost addition would be better in the individual decorator constructors to avoid making the getCost method to add to the original cost
Amazing explanation. Thanks a lot. Don't stop this series.
Thanks for the feedback! Do share it among your friends!!
I’m not sure if I missed something but I believe the part as to how a room would be saved against a date. That is how do we save that a room is booked for certain dates and available for certain dates. Moreover, how would we be storing it in db as well?
I found this to be missed in another hotel booking lld as well.
Hello Soumyajit, Thanks for the video!!. Is it a good practice to use Enums, or go for multiple classes or interfaces ?. Please help
Thanks for your hardwork. You are helping the community.
Always! ❤️.
Just keep .e supporting.
Thank you for this content. I have a very naive question here.....BaseRoomCharge is an interface so how come we are instating an object for the interface in RoomService and RooomCharge class?
we are just using reference of interface BaseRoomCharge. in reality the object will be of RoomCharge. we will be initializing BaseRoomCharge variable to an object by passing the same in constructor.
@@Kavishkhullar Could we directly use RoomCharge object instead of reference to BaseRoomCharge
Awesome man never seen such video in detial :)
By the way subscribed
Glad ❤️
Thank you for explanation. Small doubt I have is, for createBooking method, we are sending only guestInfo, but how will we know the room info to book? Shouldn't we be sending the room info also?
@Soumyajit Bhattacharya , thanks for the awesome content, but I have one doubt , why can't we keep add addRoomKey method in Room class , instead of keeping assignRoom method in RoomKey class. what is the advantage of the approach discussed in the video, and what is the demerit in what I asked. Thanks a ton, please revert back with an answer 🙏
Think about RFID access cards, they are assigned to a room when you check in.
HI, can you make a video on Solution Design for things like total booking amount calculation and stuff? I'm having a hard time understanding what to do with a solution design,
Content is really helpful & simple.
Thanks so much for the feedback! Really appreciate it!! Stay tuned as I will be uploading more such LLD videos, interview experiences and mock interview videos as well!
very well put together.Will be looking towards more of design videos
Thanks for the feedback!!
I have alow level design playlist that you can go through! There are many more design problems that i have solved. Many more i am solving and will be uploading one after the other!
@@SoumyajitBhattacharyay will be waiting for upcoming video. And I saw other videos of lld as well. They are very nice. Finally a one stop channel.keep up the good work
I believe Person can be made an Interface or Fully Abstract class as it does not share code between two sub-classes. Also, multiple interfaces can be implemented by a sub-class, and hence a sub-class like Guest can implement Person and SearchFunctionality, BookingFunctionality all at the same time.
class Guest implements Person, SearchFuncitonality, BookingFunctionality{
...
}
Please guide me if I m in the wrong direction.
Thank you. Great concise content but you can make it much better by more detailed discussions.
Its dammm goood brother, hats of to you love you bro🤩
one of the best video for LLD.
keep it up!
Really appreciate the feedback!. Do share it among your friends!
Will you focus on creating more LLD videos?
Thanks for uploading this video. You have beautifully simplified such a complex concept. Loved it.
Thanks so much amit! Really appreciate it 😄
Nice explanation
Hi Soumyajit, quick question... why did you use an Integer type for the 'id' of your hotel, but a primitive int type as your zip/pin for your location?
why doesn't hotel class have receptioninst, admins and list guests in it? is it because no actore should be placed inside the class of another actor?
First of all thanks for these great content! I have query,currently i am in final year and I do know OOPs but all these stuff is overwhelming for me.Can you share some resource I can refer for better understanding? Also,as a fresher how much knowledge of OOD and system design is expected in interviews for companies like amazon?Thanks again.
Thanks, for the kind words.
As a fresher at least a basic knowledge of OOD design is expected. No knowledge of System design is expected at all.
Apart from this, I will be collating the resources and sharing them. Apart from this, I will also start a video series on design patterns basics. Make sure to watch that a well.
Do subscribe and share it among your friends!
@@SoumyajitBhattacharyay Already did that,your videos are so helpful it doesn't need advertising! :)
@@SoumyajitBhattacharyay Video is really helpful for Preparing for interviews. But wondering how Housekeeper will have access to all room objects, in order to return a list serviced by him
Usually in production system I haven’t seen any CancelObj, SearchObj being stored. APIs are exposed for search room functionality and either of the actor can access it
a little high level for me now, but it was good
very nice explanation, keep grinding
Why you are putting roomstyle as enum?. If we are going to add one more roomstyle then we need to alter the roomstyle enum in that case it violates open close design principle. Instead of enum we can create roomstyle as subclass.
The videos are really really good !!
Last two classes implementing BaseRoomCharge are incomplete. You need to assign an instance to the member baseRoomCharge. Also, define the set method to set the cost of the child classes.
hey i have generally not defined any setters or getters. otherwise it becones too big.
setters and getters are not expected to be implemented in an Interview setting.
@@SoumyajitBhattacharyay But without that it's really hard to understand how the decorator pattern is helping here.
Why do you say that search api should be in guest/receptionist class? user.search(abc_hotel) ...does it make sense? How can searching hotel be a property of user class? Shouldnt it be oyo.search(abc_hotel) ...? Because oyo(our hotel mgmt class onject) conatins all the data abt hotels so this object is supposed to have the search api.....
would you flush the housekeeping logs once the customer checks-out of a room ?
Superb, simply awesome.
I am so glad that you likedit. Do share it amaong youtf friends
It will help the channdl
Very informative videos 👌
Great explanation, It would be great if you include class relationships like associations, decompositions, etc.
Also one doubt I have is how you decided that person class would be an abstract class also room charge as interface?
well, abstract class is more of generalization, i mean the common method is used by other class therefore we used person as abstract class. But interfaces are more of standardization where you can put abstract method that has to be implemented according to the use case. So getCost method has different implementation in different classes as you can see.
Thanks for it .
Can you please create video for chess LLD design ?
Thanks for the feedback. It is already in the pipeline
Why do we have separate classes for Booking and RoomBooking? Why can't createBooking and cancelBooking be a part of the RoomBooking class itself?
Can you please create videos on Elevator, Tic Tac Toe & online stock brokerage system (eagerly waiting)
I have one made on online stock brokerage system. Will make of tic tac toe and elevator as well and subsequently add them
@@SoumyajitBhattacharyay I didn't find stock system video, can you please share the link.
Best LLD content
Glad you liked it
Do share it among your friends
In interview, do we have to write all the code for functions..I mean it will be very lengthy than?
Great work sir
great work my friend, keep it up.
Have a doubt here. Room is part of Hotel class, which is fine. But why RoomStatus is part of Room class? A room will have different status on different days. Am I missing something or is it done wrong here?
Hi Soumyajit,
I didn't get the server actor action implementation . Which part of low level design considered that.
Thankyou amazing explanation
Hi All. When we talk about the Hotel management system. what situation do we need to consider?
1. it's a stand-alone application running at a particular hotel location and user can make booking from hotel location only.
2. It's a stand-alone application for particular hotel, but user can do booking from remote location as well (we may need to deal with concurrency).
3. Similar to hotel booking service from 'make my trip' like applicatons
i guess 2nd option
Why not have the book and cancel methods defined in the room class. Since, room is the object on which these actions need to be performed. Also, could move the searchRoom method to the hotel class.
why you dont include server class for generating notifications ?
UUID (Universally Unique Identifier)
can we do this program in java script as well
Great explanation!
Thanks Abhijeet 😄😄
Do subscribe to the channel and share it among your friends!! ❤❤
Nice content.
what is functionality for getAllroomBooking in guest class? which requirement it does fulfill?
Hi,
It was done so that the guest who will be staying in the hotel is able to see all the booking detail of all the rooms that the guest has done.
If you have booked anything, generally systems allow you to see all the items that you have booked, all the times you have ordered from an online e commerce platform, all the tickets you have ordered from an online ticketing system etc.
Hi, new LLD video is up!! It is LLD of book my show.
nice
nice...❤❤❤❤❤❤❤❤
Won't we need to pass roomid in createBooking API inside Booking, otherwise how would we know which room is getting booked
can you suggest good sources to understand SOLID principles.
Don't worry. I will come up with video explanation of Solid design principles! 🎉 In the coming weeks shortly
Amazing content.
Glad you liked it!
Great video but still not getting what is the use of assignRoom API in roomkey class could someone give me an explanation?
I think it should be in Room class itself
No. It all depends on what kind of key we are talking about. Here, I had made thinking a key card, which can be programmed to unlock any room. Hence the function in the key class ❤️
How can be Booking inside Guest and Booking uses Guest as an input in its member function?
It gives error in c++, can someone help?
Thank you for this amazing content!
Thanks for the feedback!
Enjoyed it ❤️
Thanks!!
Anybody knows will i be asked to draw class diagram ?
Decorator is wrongly implemented basedecorator should hold instance of interface and it should be abstract class
this approach of the designing system looks a bit odd to me as in actuality we make APIs, controllers, etc, and the entities(guest, admin, etc) are represented as models, generally, the models don't have any(which perform some heavy actions as mentioned here in the video) methods inside them rather the service class have these methods.
For example, for adding/deleting a room we can have APIs to add and delete a room respectively and the controller methods can call service like "RoomManagementService" which can add/delete a room to/from inventory(db).
@Soumyajit Please let me know what do you think about this? In what way should one approach the problem?
What is similar to enum in c++
whenever I watch LLD videos i understand everything but when I try to solve a problem it just cannot implement it.
Do you have any tips???
Try to think about that object how should it ideally behave in real world. For example : You know about Hotel , how they operate. Then just try to think about the actors and their actions. Proceed slowly.
I am still confused why we need Hotel class as there will only be a single hotel for which this hms is used, can anyone please clear this doubt.
Ok so where is your decorator class i mean you just made an interface and extended it, I agree you are using definition of decorator pattern but not actually the decorator pattern
Notification service ?
I have added a new video on amazon shopping website. There i have explained in detail the notification service
@@SoumyajitBhattacharyay os questions
Sure will make a video answering those.
how will you solve two users can't book the same room problem?
I think so i had answered it in one of the comments. But on a high level, these can be done in myriad of ways. Completely depending on how we implement the underlying database and corresponding access to it.
There is something known as optimistic locking, which we can take use of to lock access to a particular row in our database while it is being read till it has been written or the operation times out.
@@SoumyajitBhattacharyay thanks for quick reply. Great video
Does the interviewer not expect us to write logic of the different methods ?
It depends from one interviewer to another. Ideally LLD is not about implementation. LLD comprise of db design api design and class structure design.
Even in the LLD that we do in the products/services that we build we do it. Implementation is different than LLD.
How ever some interviewers might ask to implement some of the functions as well.
@@SoumyajitBhattacharyay thank you for responding. Did not expect that.
So I am preparing for this company and they ask a question “Design a hotel system with these features...” basically almost similar to the features you have. But they ask this in the machine coding round, I think in machine coding round they would want the full fledged system. Is my assumption correct?
Also, do they not expect us to use a database since your solution (even though brilliant) does not store any data persistently ?
@@SoumyajitBhattacharyay just saw on your linkedin that you did your graduation from my hometown :D
Yes that is correvt. Generally these rounds are expected to be vompletely in memory. That is something that is a bit difficult to grasp first up.
While doing machine coding round, yes a solution is expected. So you might have to implement the methods. But the time given for that is usually more somewhere around 1.5 to 2 hrs at least
@@SoumyajitBhattacharyay yes, that company gives 1.5 hours. What is the time provided for the solution that you have shown ?
I don't know why you were in a hurry in the end, but you should have spent more time on the last topics rather than explaining basic classes and inheritance concepts.
If we go via SOLID principles, is getting rooms serviced responsibility of HouseKeeper class ? I think No as the list would be needed to be fetched from a data store and a person class going to a data store via a Dao class isn't a correct design. Nowt the question is that who will provide this information ? To answer this, first we need to know who needs this information ? It must be admin or a receptionist as they might face a situation where they might need to have this information. So will they ask housekeeper ? No. There should be a Dao class which can provide this information directly. Housekeeper may be the source of truth but that truth has been logged into data store. Job of housekeeper is to do house keeping and enter corresponding logs.
Instead housekeeping class should expose a function as :
public void serveRequest(Room room, ServiceType serviceType);
1.i think it will it will just inform DAO to get me result,it will not have code to actaully connect to data store.And this does not violate Single responsibility principle.if we see a library system, a use should be able to reserve a book,so there is an api in user to reserverBook, it will ask data layer or some reservation service to do booking,so talking to external layers does not voilate SRP.otherwise it will be just a pojo object?Let me know your thoughts
2.housekeepr should have api to addHouseKeeping Logs given a room.That i agree with you.
these are good doubts u raised. thanks
this system will fail very badly
Really bad explanation
Hi @soumyajit : I have a doubt in drive.google.com/file/d/1GFDk4DBOtefSbuUioAQ5D3T2-cH9m47l/view . (1) What is the use of RoomCharge class (2) In RoomServiceCharge class, don't understand baseRoomCharge.setCost(baseRoomCharge.getCost() + cost); BECAUSE (a) baseRoomCharge doesn't have setCost (b) baseRoomCharge doesn't have cost field. Please help. I am preparing for SD LLD in Java and making your videos as base.
Thank you. Amazing content!