GOOGLE INTERVIEW QUESTION SOLVED | LOW LEVEL DESIGN CODE | LIBRARY MANAGEMENT SYSTEM - PART2

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

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

  • @SuperPabbs
    @SuperPabbs 4 года назад +13

    Very well explained. Could you please make a LLD video which emulates a real interview setup. Like how it start with a vague problem statement and the discussion about requirement details that follows between the interviewer and the candidate. Thanks for doing these videos :)

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

    Very well explained, we can do one addition here as both user and book have barcode we can have a separate interface or class for barcode with helps in defining the barcode and assigning it.

  • @indraneelkeetha4962
    @indraneelkeetha4962 4 года назад +13

    Hey!! Thanks for the upload.
    3:59 Instead of extending BookItem with Book. I feel we should prefer composition over inheritance? And in actual application it would be helpful for storing it as two tables. What do you think are the drawbacks for the below design?
    class BookInfo {
    String uniqueIdNumber;
    String title;
    List authors;
    BookType bookType;
    }
    class BookItem {
    BookInfo bookInfo;
    String barcode;
    Date publicationDate;
    Rack rackLocation;
    BookStatus bookStatus;
    BookFormat bookFormat;
    Date issueDate;
    }

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

      My guess would be is-a vs has-a relationship. BookItem is a Book. Here, the subclass is a proper subtype of the parent class. And even in the requirements, it says that these BookItems are copies of a Book.

    • @yogeshkumargupta265
      @yogeshkumargupta265 2 года назад +2

      I also think that a composition would be better idea. We have hunders of bookItems, all of which belong to same bookInfo. It does not make sense to duplicate the information in each and every bookItem class object.

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

    Very helpful. Would be great if you could also add db design for this. Should we design db thinking of classes or not? I always had this doubt!

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

    It's awasome the way you make it simple..now we can call it "jolbhaat"...aaro LLD videos chai bhai...

  • @garimachaturvedi737
    @garimachaturvedi737 3 года назад +12

    Great work Soumyajit, you're awesome!!! Just a thought though, we could have overloaded the getBook function in the Search class to take in 4 different parameters shown here rather than having 4 different functions. Lemme know what you think about this. Thanks & best wishes to you!! :)

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

    Great Job Soumyajit Bhattacharyay !!!

  • @quirkyquester
    @quirkyquester 6 месяцев назад

    Brother you make the most fires oop video, I love it

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

    It would be very helpful if you could share the requirement and actors doc link as well.

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

    Hi Soumya, one thing I wanted to highlight is that in the real interview we would need to run this and show some data. How would we write the driver code in best possible way? In actual interview even if your design is not that great but your code is working with data and all the features is more important. Becoz then we also have to provide the implementation for all the interfaces we defined.

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

      That is not true at all
      It depends on the interviewer and what they want to see. In one of my interviews I was asked to write the entire implementation.
      In some I was asked to write just the implementation of one or two features.
      And in most, I was simply asked to write class design, db design, api contracts.

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

      @@SoumyajitBhattacharyay Yeah agreed.. Many won't ask but many are there who ask. But I just gave it as a feedback.. Becoz I wanted your videos to the one stop solution for LLD. Anyways Np.

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

    Great learning bro!! Haven't you missed notification part?

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

    Great video! One question - Could the Search and BookIssueService be directly added to SystemUser class instead of adding both of them to its child classes i.e. Member and Librarian?

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

      it can be, but then it will voilate Dependency Inversion principle (SOLID).

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

      @@naveengarg7435 how exactly will it violate Dependency Inversion principle, could you please explain ? We will still be relying on interfaces for Search and BookIssueService functionality.

  • @Gurpreetkaur-ws4fv
    @Gurpreetkaur-ws4fv 3 года назад +1

    can you do a video on Shipment tracking service and car rental service as well ?

  • @Abhishek.sharma499
    @Abhishek.sharma499 4 года назад +1

    I believe the book Isuse service should not contain methods for issuing and reserving books. These methods belong to Lending class and Book reservation class. The book issue service is just a wrapper because we don't want to replicate the code to both member and librarian. But, this does not make the bookIssueService the owner of these methods. The owner still remains the lending class and reservation class. Now the book issue service may contain object of Lender and reservation which will call the lending and reservation methods or we may completely remove the book issue service and directly put these objects inside the member and librarian too make use of it. But, just because we want to remove code duplicacy, I believe it is wrong to change the ownership of method from lender and book reservation, assign it to a completely new class which is a book issue service.

  • @IouSanx
    @IouSanx 7 месяцев назад

    In LLD interviews, is the expectation to write the entire code with logic? Or define the basic structure with the classes and their attributes and methods?

  • @deb-22
    @deb-22 2 года назад

    It was a great video, learnt a lot .Only have one question ,in an Interview whether the requirements will be given to us or we have to ask the interviewer about our queries regarding the requirements or we just have to assume the requirements? Thanks for answering in advance!

  • @Prashantkumar-pn6qq
    @Prashantkumar-pn6qq 3 года назад +1

    Short and Crisp. Thanks, Soumyajit. Do you have resources on HLD as well?

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

    Very Good and valuable content to learn and implement things....please do one video on multithreading or atleast add to the to-do list. Bro

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

    I think you missed out Actor: server and notification action.

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

    Can you please explain why or why not we can put Search and BookIssueService in the SystemUser class ?

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

    Great work Soumyajit really helps. Had one question
    Why do we need to store info about BookFormat?

  • @HarshalDev
    @HarshalDev 7 месяцев назад

    What about the methods of each class? What if the interviewers wants us to also implement relevant methods for the said classes, then how shall we practise the same?

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

    extremely pyari explaination :)

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

    I have a small doubt here,
    Why cannot we define the search and book issue service functions inside the Memeber class, since it will already be inherited by the User and Librarian class?
    This would also help us override the search method for eg. in case we don't want to show lost books to customer but librarian can still see it.
    Can we override the Search class methods from the Customer class in java ?

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

    I believe library should have racks, and racks should have books. Book(Item) shouldn't contain rack details.

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

    Hi this was great video on LLD. Can search and bookIssueService class be made singleton or static ?

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

      Yes they can be made singleton in nature. Infact most of the service classes are by default singleton classes

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

      @@SoumyajitBhattacharyay Thanks for your response

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

    Hey!! Thanks for these videos.
    In the video, FineService was defined but not in Java Code provided by you. You can please that.

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

    i guess writing algorithms and implementing data structures is not a part of LLD? i thought i would see i a complete working code, implementing search through binary search,storing in heap , and other implementations . rest the video was nice and contained all classes

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

    Why the API's aren't implemented ? In the real interview we are expected to write up some of the methods implementation.

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

    Thanks for the video.amazing it is! Everything was decoupled so nicely. I want to be part of the mock interview series.What needs to be done for that?

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

      Thanks for the feedback.
      Sure, can you please connect with me over instagram and we can discusbthe details of the mock interview?

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

    Thank you so much. Excellent video to learn LLD.
    One doubt though. We are not storing BookIssueDetails anywhere. Does this mean we are storing BookIssuedetails in DB ? So if I have to search for the books issued to a user, how can I know that?

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

      I think that there should be 1 table in the DB(relational) that contains issued books data like IssueId, borrowerId, dateTimeOfIssue, bookItemId, etc. So if you need books issued to a particular member, just query this table passing his ID. Hope I understood your ques right.

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

    Hello, Thanks a lot for the video, its one of the best for explaining OO design paradigms. I find it a bit hard to gather how we are taking care of the fines though. Should the BookIssueService not have a list of BookLendings, so it can track all reservations/issues for one account?

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

    I am new here. Dont we have to write implementation of functions in our low level design during interviews?

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

    If we search on the basis of author then we'll get list of books instead of bookItems hence we wont be able to issue books based on the list of books.

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

    can we use prototype design pattern in BookItem class ? so that every time when new copy of book is added in the inventory we only have to change few fields and persist data. Any views on this?

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

    It seems that your solution doesn't take account list books which a systemUser currently has . Also which book is issued to which user is also missing.

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

    Great and Awesome stuff bro. If interviewer asked for the design patterns we used?

  • @Ranjeetkumar-do5bx
    @Ranjeetkumar-do5bx 4 года назад

    Why we need SystemUser & Account as seperate classes..both can be merged into 1 class...right?.. as we will not do code duplication also & both classes has relevant data..

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

    in these case study where can we use abstract class as i have difficulty using abstract class in real life example.

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

    Great video 👍. When will next video come?

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

      Thanks for the feedback. The next low level design video will come later this week! 🙂

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

      @@SoumyajitBhattacharyay please add extension/modification in feature like ask in interview.

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

      Yes, it is a good suggestion. I have added the same in my low level design book my show video.
      ruclips.net/video/7LaKmNfMCAo/видео.html

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

    Hello, the code seems overwhelming to me ,a fresher. Please advice me on how to proceed with lld. I find it hard to put the concepts to code.

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

    why we need library class? Also should nt the "barcode" be the input to the APIs rather than BookItem

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

    Thanks a alot

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

    Can we make the account class as abstract class and add resetPassword method to it?

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

      No it cant be anstract as first time we will have to intialize the account object for a particular use. Reset password can be added.

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

    library class should be singleton

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

    Book item list is defined in Library class. but for the search class to search for a book with a particular Author's name it needs a list of book items..can someone please tell me how do we pass this list?

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

    "Person" and "SystemUser" should be declared as abstract classes as their instantiation has no significance.

  • @backbencher33-mkm
    @backbencher33-mkm 3 года назад +2

    Copy of grokkling system design

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

    Great Stuff !!

  • @SushilKumar-wt7js
    @SushilKumar-wt7js 4 года назад

    hey what if I want to find that to whom this particular book is assigned, how can I find that? by keeping customer id in book item?

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

      probably - Bookissueservice has getReservationDetail api

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

    BookItem HAS a book and IS not a book itself. I belive book should be an attribute of the BookItem class.

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

      Also Author is not an Actor on the system. It makes sense to have another base class like Actor extends Person.

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

      Hi generally as a rule of thunb the is a and has a relationships are applied over real world objects. hence Book item is considered as the real world representation of the book here.

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

    Share requirements too

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

      It is shred in the previous video already. 😊

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

      @@SoumyajitBhattacharyay requirements which you are reading and making all usecases... It's not there

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

      Isnt it in the part 1 video. This is the part 2 video of it. 😊 Or are you requesting the file. In that case it's not there. Sure will add it.

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

    Could you do a LLD video on how to design Linux Find file Command. Also I think the parameters should be private in order to show Encapsulation.

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

    Rack class should contain BookItem , but here BookItem is containing RackLocation

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

    why is Search not called SearchService?

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

      Yes search can be called a search service here. Because it will be implementing ther service aspect of search.

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

    Hi,
    1. How will you support edit,delete,update book item operations?Dont you think we use use Hasmap instead of List in library class to support these operations in constant time as edit,delete,add will result in updating data in Library class List.
    2. How will this information be passed to search service so that it can update its data?
    3.Why do we need to put searchService and BookIssueService objects in Member and librarian Class?Book issue service will take user and book while issuing a book,but it will not be called from Member class,right?We will not say Member.issueService.issueBook,it does not make sense.I mean we cannot show that interaction will classCode only.
    Let me know your thoughts?

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

      1) How ever you may go ahead and use a hashmap, But be mindful as it is not required here. The edit, delete and update operations will not be done in memory. These operations will be done in persistent storage and hence a hashmap not required.
      2) For performing basic CRUD operations we can have specific APIs that do the same, But with the problem statement in mind need to define the basic CRUD APIs.
      3) The BookIssue service will be called from the member class. As per the requirements, the member should be able to issue books on their own. If you go and watch the use case diagram it will be come more clear as to which class should have access to which services. Hence it should be a part of the Member class as now, it will give the Member object (AKA the person who want to borrow the book) permissions to issue the book using the system rather than having to do that through the librarian. Apart from the Member the librarian should also have the scope to access the BookIssueService and the SearchService.
      Member should be given exact permissions to actually perform searches and issue book by self checkout kiosks. That is the whole point of the Library management system.You can go through my previous video to understand the interaction between the different actors to get an understanding of the scope of the system.
      Before writing the code, we should analyse all the work flows properly and then only start with their implementation.

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

      ​@@SoumyajitBhattacharyay Thanks for quick reply.I am fine with point 1 and 2 raised above.But i still have doubts about 3rd point.So do we need to add methods of issue book and all in Member class also?Which will internally call Book reservation issue?Dont you think that it is not responsibility of user class to manage book issue/return and renew. Shouldn't this responsibility be separated from member class?

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

    Did anyone notice the time on his Laptop?

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

      Hahah. That is the time that I get to shoot the videos. 😊

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

      @@SoumyajitBhattacharyay Kudos to your hardwork Bhaiya. Your videos are really helpful. I'll crack Product based some day and tag you on LinkedIn 😁

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

      Heheh. Thank you 💗. Yaar bilkul.

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

    If someone give these requirements written in full sentences, i believe anyone can come up with their own LLD. The difficult part is understanding the ask and gather requirements.

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

      Not true for the first part. True for the second part.
      I have seen way too many folks not come up with the design of systems even after getting the requirements.
      But true, coming up with the requirements that will happen over time when you are exposes to such scenarios at work.
      At work we constantly get such scenarios where we have to create the entire business requirement document also known as the BRD. It is something that cannot be tought and have to come with experience.

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

    bhai pehele class diagram toh bataao, seedha code kar diye ho