Google Interview Question Solved| Low Level Design Complete Code | Hotel Management System | Part 2

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 154

  • @madhvimittal8266
    @madhvimittal8266 2 года назад +22

    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

  • @sakshiaggarwal4570
    @sakshiaggarwal4570 4 года назад +8

    Thank you for explaining LLD in simple words. The most detailed and understable low level design video I have ever came across!

  • @amitk6701
    @amitk6701 4 года назад +6

    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!

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      Yes thats a great suggestion. I will surely create a github project as well!!

  • @randomtutorials9628
    @randomtutorials9628 4 года назад +3

    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.

  • @palaktosh2256
    @palaktosh2256 2 года назад

    Best video on LLD so far better than paid websites. please include class diagram in LLD as well.

  • @adilmemon9526
    @adilmemon9526 2 года назад

    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.

  • @varungarg03
    @varungarg03 4 года назад +9

    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
      @SoumyajitBhattacharyay  4 года назад +18

      that is a great feedback. i am thinking of starting a video series explaining commonly used pattern along with example. whats say??

    • @varungarg03
      @varungarg03 4 года назад +1

      ​@@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?

    • @amitagrawal4660
      @amitagrawal4660 3 года назад

      @@SoumyajitBhattacharyay Please do it

    • @lokeshgupta5649
      @lokeshgupta5649 2 года назад

      @@SoumyajitBhattacharyay Sure

  • @026harshagarwal9
    @026harshagarwal9 3 месяца назад

    Superb explanation!! Honestly, I went through some of the LLD videos but this is the one which I like the most. Thanks!!

  • @saurabhsinghscuboid
    @saurabhsinghscuboid 2 года назад +12

    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.

    • @deepaktathe976
      @deepaktathe976 Год назад

      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?

    • @balasravandindukurthi4702
      @balasravandindukurthi4702 Год назад

      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();
      }
      }

  • @rahulsharma5030
    @rahulsharma5030 4 года назад +12

    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?

  • @techshala8929
    @techshala8929 4 года назад +4

    This is exceptional content!! Simply awesome. Not seen such detailed video before on youtube!!! Simply love this channel!!

  • @sayanroy9161
    @sayanroy9161 4 года назад +3

    Good video. 1) please go slow 2) why booking and searching implement as a class instead of interface.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      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!

  • @sarvasva2009
    @sarvasva2009 4 года назад

    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.

  • @priyansupulak2242
    @priyansupulak2242 4 года назад +1

    One of the finest video, I have ever seen on LLD. Thanks For uploading.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад +1

      Thanks for the feedback!. Do stay tuned, i will be uploading lld for stack overflow tomorrow!
      Do share it among your friends!

    • @priyansupulak2242
      @priyansupulak2242 4 года назад

      @@SoumyajitBhattacharyay Would love to watch that as well.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад +1

      The stack overflow LLD video is live!
      Do share it among your friends!

    • @priyansupulak2242
      @priyansupulak2242 3 года назад

      @@SoumyajitBhattacharyay Its awesome as well,

  • @swaroopas5207
    @swaroopas5207 3 года назад +1

    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?

  • @ranitdey7369
    @ranitdey7369 4 года назад

    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 ??

  • @PratikShah123
    @PratikShah123 3 года назад

    @Soumyajit, Thanks a lot. However small suggestion for all LLD use cases. They all are ignoring 1NF form of the DBs. Avoid having List.

  • @lakshaygupta6180
    @lakshaygupta6180 3 года назад +1

    This is what I was looking for. Thank you for this amazing content.

  • @rahulshetty5366
    @rahulshetty5366 2 года назад +1

    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

  • @MegaSethi
    @MegaSethi 4 года назад

    Amazing explanation. Thanks a lot. Don't stop this series.

  • @unav-daily
    @unav-daily 10 месяцев назад

    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.

  • @rutujpuranik9370
    @rutujpuranik9370 3 года назад +1

    Hello Soumyajit, Thanks for the video!!. Is it a good practice to use Enums, or go for multiple classes or interfaces ?. Please help

  • @mrinalraj7166
    @mrinalraj7166 3 года назад

    Thanks for your hardwork. You are helping the community.

  • @deanwinchester7972
    @deanwinchester7972 3 года назад +1

    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?

    • @Kavishkhullar
      @Kavishkhullar 3 года назад

      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.

    • @harshdeepsingh3189
      @harshdeepsingh3189 3 года назад

      @@Kavishkhullar Could we directly use RoomCharge object instead of reference to BaseRoomCharge

  • @kakhan2086
    @kakhan2086 3 года назад

    Awesome man never seen such video in detial :)
    By the way subscribed

  • @annepuvijay3743
    @annepuvijay3743 2 года назад

    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?

  • @rajugaurav5052
    @rajugaurav5052 3 года назад +1

    @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 🙏

    • @pankajdx
      @pankajdx 2 года назад

      Think about RFID access cards, they are assigned to a room when you check in.

  • @itzbubuind
    @itzbubuind 10 месяцев назад

    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,

  • @ritugupta3367
    @ritugupta3367 4 года назад +1

    Content is really helpful & simple.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      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!

  • @ankush363
    @ankush363 4 года назад +1

    very well put together.Will be looking towards more of design videos

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      Thanks for the feedback!!

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад +1

      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!

    • @ankush363
      @ankush363 4 года назад +1

      @@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

  • @zyro9922
    @zyro9922 3 года назад

    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.

  • @himanshusharma1066
    @himanshusharma1066 5 месяцев назад

    Its dammm goood brother, hats of to you love you bro🤩

  • @jayeshbaviskar
    @jayeshbaviskar 4 года назад

    one of the best video for LLD.
    keep it up!

  • @kirtimanmishra8097
    @kirtimanmishra8097 2 года назад

    Will you focus on creating more LLD videos?

  • @amitprakashpandeysonu
    @amitprakashpandeysonu 3 года назад

    Thanks for uploading this video. You have beautifully simplified such a complex concept. Loved it.

  • @SANDIPKUMAR-es7qh
    @SANDIPKUMAR-es7qh 2 года назад

    Nice explanation

  • @MichaelStephenLau
    @MichaelStephenLau 3 года назад

    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?

  • @samiles171094
    @samiles171094 2 года назад +1

    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?

  • @ayushraj-zb6sv
    @ayushraj-zb6sv 3 года назад

    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.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад +1

      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!

    • @ayushraj-zb6sv
      @ayushraj-zb6sv 3 года назад

      @@SoumyajitBhattacharyay Already did that,your videos are so helpful it doesn't need advertising! :)

    • @arihantjainable
      @arihantjainable 3 года назад

      @@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

  • @gaurika4927
    @gaurika4927 2 года назад

    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

  • @vaibhavrawat4008
    @vaibhavrawat4008 26 дней назад

    a little high level for me now, but it was good

  • @sahildhiman7675
    @sahildhiman7675 2 года назад

    very nice explanation, keep grinding

  • @rameshramasamy878
    @rameshramasamy878 3 года назад +2

    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.

  • @utkarshgupta2909
    @utkarshgupta2909 2 года назад

    The videos are really really good !!

  • @sahilh14
    @sahilh14 4 года назад +2

    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.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад +1

      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.

    • @sahilh14
      @sahilh14 4 года назад +3

      @@SoumyajitBhattacharyay But without that it's really hard to understand how the decorator pattern is helping here.

  • @ayushjindal4981
    @ayushjindal4981 3 года назад +3

    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.....

  • @rishabhgoel1877
    @rishabhgoel1877 2 года назад

    would you flush the housekeeping logs once the customer checks-out of a room ?

  • @subhajitdas2784
    @subhajitdas2784 3 года назад

    Superb, simply awesome.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад +1

      I am so glad that you likedit. Do share it amaong youtf friends
      It will help the channdl

  • @yalairfan7252
    @yalairfan7252 3 года назад

    Very informative videos 👌

  • @rupeshjha4717
    @rupeshjha4717 4 года назад +1

    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?

    • @RishabhYadav-gp6nu
      @RishabhYadav-gp6nu 2 года назад

      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.

  • @kunal4350
    @kunal4350 4 года назад +1

    Thanks for it .
    Can you please create video for chess LLD design ?

  • @poorvajas6600
    @poorvajas6600 2 года назад

    Why do we have separate classes for Booking and RoomBooking? Why can't createBooking and cancelBooking be a part of the RoomBooking class itself?

  • @amitagrawal4660
    @amitagrawal4660 3 года назад

    Can you please create videos on Elevator, Tic Tac Toe & online stock brokerage system (eagerly waiting)

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад

      I have one made on online stock brokerage system. Will make of tic tac toe and elevator as well and subsequently add them

    • @amitagrawal4660
      @amitagrawal4660 3 года назад

      @@SoumyajitBhattacharyay I didn't find stock system video, can you please share the link.

  • @SUNNYKUMAR-cl1xw
    @SUNNYKUMAR-cl1xw 3 года назад

    Best LLD content

  • @yushdecides
    @yushdecides 3 года назад

    In interview, do we have to write all the code for functions..I mean it will be very lengthy than?

  • @siddeshsasane5607
    @siddeshsasane5607 3 года назад

    Great work sir

  • @shaivaljava401
    @shaivaljava401 3 года назад

    great work my friend, keep it up.

  • @aakashgq
    @aakashgq 9 месяцев назад

    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?

  • @darkknigh874
    @darkknigh874 4 года назад

    Hi Soumyajit,
    I didn't get the server actor action implementation . Which part of low level design considered that.

  • @sukanyasinha3583
    @sukanyasinha3583 4 года назад

    Thankyou amazing explanation

  • @bipinshakya3881
    @bipinshakya3881 3 года назад +2

    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

  • @sahilh14
    @sahilh14 4 года назад

    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.

  • @ajaywadhwa3398
    @ajaywadhwa3398 3 года назад

    why you dont include server class for generating notifications ?

  • @mukeshbarman
    @mukeshbarman Год назад

    UUID (Universally Unique Identifier)

  • @AshishSharma-vv5ew
    @AshishSharma-vv5ew Год назад

    can we do this program in java script as well

  • @abhijeetkumar3569
    @abhijeetkumar3569 3 года назад

    Great explanation!

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад +1

      Thanks Abhijeet 😄😄
      Do subscribe to the channel and share it among your friends!! ❤❤

  • @prateekkumar9815
    @prateekkumar9815 4 года назад

    Nice content.

  • @sayanroy9161
    @sayanroy9161 4 года назад +1

    what is functionality for getAllroomBooking in guest class? which requirement it does fulfill?

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      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.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      Hi, new LLD video is up!! It is LLD of book my show.

  • @vinamrasangal8436
    @vinamrasangal8436 4 месяца назад

    nice

  • @Braveuser-x7j
    @Braveuser-x7j 4 месяца назад

    nice...❤❤❤❤❤❤❤❤

  • @goblin1390
    @goblin1390 3 года назад

    Won't we need to pass roomid in createBooking API inside Booking, otherwise how would we know which room is getting booked

  • @nehapandit9409
    @nehapandit9409 3 года назад

    can you suggest good sources to understand SOLID principles.

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад

      Don't worry. I will come up with video explanation of Solid design principles! 🎉 In the coming weeks shortly

  • @excitedkiddo499
    @excitedkiddo499 3 года назад

    Amazing content.

  • @aakash1763
    @aakash1763 3 года назад

    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

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад

      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 ❤️

  • @vasudev6960
    @vasudev6960 2 года назад

    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?

  • @akankshakanjolia2969
    @akankshakanjolia2969 4 года назад

    Thank you for this amazing content!

  • @abhijeetbaranwal
    @abhijeetbaranwal 3 года назад

    Enjoyed it ❤️

  • @krishnarajyadav3953
    @krishnarajyadav3953 3 года назад

    Anybody knows will i be asked to draw class diagram ?

  • @tejeshd5278
    @tejeshd5278 4 месяца назад

    Decorator is wrongly implemented basedecorator should hold instance of interface and it should be abstract class

  • @samiles171094
    @samiles171094 2 года назад

    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?

  • @lofibeats2344
    @lofibeats2344 2 года назад

    What is similar to enum in c++

  • @yashCeo
    @yashCeo 3 года назад

    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???

    • @ItachiXSanjii
      @ItachiXSanjii 3 года назад

      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.

  • @shubhamsingla9700
    @shubhamsingla9700 3 года назад

    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.

  • @amitasingh8963
    @amitasingh8963 3 года назад

    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

  • @karun4663
    @karun4663 4 года назад +1

    Notification service ?

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      I have added a new video on amazon shopping website. There i have explained in detail the notification service

    • @karun4663
      @karun4663 4 года назад

      @@SoumyajitBhattacharyay os questions

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  4 года назад

      Sure will make a video answering those.

  • @sudhirtiwari9262
    @sudhirtiwari9262 3 года назад

    how will you solve two users can't book the same room problem?

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад +1

      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.

    • @sudhirtiwari9262
      @sudhirtiwari9262 3 года назад

      @@SoumyajitBhattacharyay thanks for quick reply. Great video

  • @harshitvijayvargia2838
    @harshitvijayvargia2838 3 года назад

    Does the interviewer not expect us to write logic of the different methods ?

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад

      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.

    • @harshitvijayvargia2838
      @harshitvijayvargia2838 3 года назад

      @@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 ?

    • @harshitvijayvargia2838
      @harshitvijayvargia2838 3 года назад

      @@SoumyajitBhattacharyay just saw on your linkedin that you did your graduation from my hometown :D

    • @SoumyajitBhattacharyay
      @SoumyajitBhattacharyay  3 года назад +1

      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

    • @harshitvijayvargia2838
      @harshitvijayvargia2838 3 года назад

      @@SoumyajitBhattacharyay yes, that company gives 1.5 hours. What is the time provided for the solution that you have shown ?

  • @zyro9922
    @zyro9922 3 года назад

    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.

  • @dextermorgan1287
    @dextermorgan1287 4 года назад +1

    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);

    • @rahulsharma5030
      @rahulsharma5030 3 года назад

      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

  • @vasujhawar.6987
    @vasujhawar.6987 Год назад

    this system will fail very badly

  • @kaushaljalan2928
    @kaushaljalan2928 Год назад

    Really bad explanation

  • @Jagrati
    @Jagrati 2 года назад +1

    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.

  • @VenkeeN17
    @VenkeeN17 3 года назад

    Thank you. Amazing content!