19. Design File System using Composite Design Pattern | Low Level Design Interview Question | LLD

Explained Composite Design Pattern with 2 Examples and their implementation:
1. Design File System
2. Design Calculator (Arithmetic Expression)
➡️ Code (GitLab) Link:
Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Git link there)
➡️ Join this channel to get access to member only perks:
/ @conceptandcoding
#systemdesign #lld #designpattern

Пікірлер: 79

  • @nitishprasadkushwaha
    @nitishprasadkushwaha11 ай бұрын

    Thank you very much for creating such a beautiful LLD playlist.

  • @nishankbhati3188
    @nishankbhati3188 Жыл бұрын

    Dude I am ~3.5 years experienced dev. Your videos are gem to watch.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Thank you 👍

  • @user-ph5ek8tg5l
    @user-ph5ek8tg5l2 ай бұрын

    Except the regular Design Patterns which we use daily in our work like Singleton, Factory, Facade, Proxy etc. which makes sense as we anyways use them daily the other patterns used to feel boring and uninteresting to me as even after reading from books and tutorials the concept just remained as theory. I felt they are not as important as we don't use them much. For the same reason i was also going to make them less priority from your playlist as well. But thanks a lot to your amazing practical explanation i am finding each Design pattern so much practical, interesting and useful and easy to remember and apply.

  • @shineinusa
    @shineinusa7 күн бұрын

    well done

  • @MujahidAli-xh6zv
    @MujahidAli-xh6zv Жыл бұрын

    I was asked similar question in Amazon. If I have watched this video earlier, result would have been different. Thank you Shrayansh for uploading it.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @user-mc8rx5en2h
    @user-mc8rx5en2h3 ай бұрын

    Perfectly explained 👏👏

  • @tarunkundhiya5196
    @tarunkundhiya5196 Жыл бұрын

    Nice explanation ! This reminded me of your isA hasA both properties needed in the Decorator pattern. This also looks similar but isA(Expression) hasTwo(Expressions) + Internal Operation. Thanks!

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Thanks

  • @rishabhgoyal8110
    @rishabhgoyal8110 Жыл бұрын

    Wow! Thanks for this. Recursive Design Pattern!

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @shaikheajajuddin8317
    @shaikheajajuddin8317 Жыл бұрын

    Great Explanation!!! Please make a video on LLD of browser history for single Tabs and Multiple Tabs.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Noted. Thanks for this question. will work on it.

  • @rajatbansal3769
    @rajatbansal3769 Жыл бұрын

    Good explanation and examples

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @abhishek2116
    @abhishek2116 Жыл бұрын

    Great sir🙏

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @ayushigupta685
    @ayushigupta6855 ай бұрын

    amazing example really

  • @ConceptandCoding

    @ConceptandCoding

    5 ай бұрын

    thank you

  • @pranavsharma7479
    @pranavsharma7479 Жыл бұрын

    Thnks bhaiya

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    welcome

  • @krishnak.maurya8400
    @krishnak.maurya84005 ай бұрын

    Thanks for explanations. Have one doubt how would i handle operator precedence in calculator design ?

  • @ashutoshparashar7138
    @ashutoshparashar7138 Жыл бұрын

    Great explanation. Please make a video on command design pattern to avoid multiple if Thanks

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    noted

  • @AyushSharma-ux4fk
    @AyushSharma-ux4fk Жыл бұрын

    Amazing video

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Thanks

  • @AniketDimri
    @AniketDimri2 ай бұрын

    Great explanation! Really appreciate your work. How can we create mkdir method in filesystem using this approach? Mkdir should be a part of only directory and not file and that need be be recursively call using ((Directory) file).mkdir(), is there a way to avoid this and use same design pattern?

  • @kushal7966
    @kushal796611 ай бұрын

    Thank You

  • @ConceptandCoding

    @ConceptandCoding

    11 ай бұрын

    Thanks

  • @pulakammalathy6968
    @pulakammalathy69683 ай бұрын

    How do we decide if filesystem should be a interface or a base class?

  • @user-vm8yn4hb4w
    @user-vm8yn4hb4w Жыл бұрын

    DAMN BRO I LOVE YOU SO MUCH

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @user-vm8yn4hb4w

    @user-vm8yn4hb4w

    Жыл бұрын

    @@ConceptandCoding Like im from korea but in korea absolutely theres no lld or oop design class for interview and also in youtube. some professors make videos for that but not that much in detail. Love ya from korea

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    @@user-vm8yn4hb4w Hi, thanks a lot. I think this is the first comment i got from outside India. Really glad you like the content :)

  • @user-vm8yn4hb4w

    @user-vm8yn4hb4w

    Жыл бұрын

    @@ConceptandCoding Like im just one outlier.. who want to get in amazon😃

  • @animay100
    @animay100 Жыл бұрын

    How would I handle multiple files in a single folder situation? Would we: 1. Create the first file as a leaf and then all subsequent files as file systems with only leaf and no child file system 2. Modify the filesystem object to have an array of leaves and an array of child file systems Please let me know which one would be the better approach? PS: Honestly, great work. I come from a place where I do not have much hands-on coding experience and these videos have really helped me and challenged me in the right kind of ways that I now feel much more confident with LLD. Great work man! Hats off to you!!

  • @geetikapaul5071

    @geetikapaul5071

    Жыл бұрын

    List implies that Directory can have either have a list of directories as leaves or list of files (leaves of files). The iterator in the ls() method will iterate over each file and call its ls() to print filename.

  • @sangammishra3670
    @sangammishra36706 ай бұрын

    Sir @Shreyansh there is one doubt that I have regarding the file system, I don't know whether I have misunderstood the problem itself, suppose I have directory ABC and in ABC I have like three other directories-> BCD, CDE, and EFG in BCD-> I have GHI, in GHI-> I have FGH. so according to your design it will print like in preorder dfs wise all the names(ABC ->BCD->GHI->FGH->CDE->EFG), but in practically if i pass ABC.ls( ) then it should print only (BCD,CDE,EFG) so how can composite design pattern help here?

  • @rishabhgupta4133

    @rishabhgupta4133

    17 күн бұрын

    actually here it is designed in such a way, that it print whole structure i.e. all nested files/directory

  • @Omanjupuru
    @Omanjupuru Жыл бұрын

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    thank you

  • @rajatpratapsingh3123
    @rajatpratapsingh3123 Жыл бұрын

    Great explanation sir, I've a question: Can LLD be learned using JS as majority content on-line is in JAVA or any other low-level languages like CPP, etc.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    any OOPs oriented language can be used Rajat. I am not much familiar with JS

  • @anupriya_sadks
    @anupriya_sadks Жыл бұрын

    Great explanation!! Could you please make a video of LLD of splitwise?

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    noted

  • @GauravSingh-pn6bp
    @GauravSingh-pn6bp Жыл бұрын

    Sir bahut achha samjhaaya aapne, ab mein interview ke liye ready hu, bas calls nahi aa rahi

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Thank you

  • @geetikapaul5071
    @geetikapaul5071 Жыл бұрын

    Hey Shrayansh, if we were to add a new operation, say modulus, then we would need to update the existing Evaluate()'s switch case to accommodate it. Thus, violating 'O' of the SOLID principles. How should we handle that? Is it by having separate class for each operation with its own evaluate method implementation?

  • @prakharjalan7546

    @prakharjalan7546

    Жыл бұрын

    Maybe we can define a method in the enum itself?

  • @LegitGamer2345

    @LegitGamer2345

    9 ай бұрын

    Could probably use chain of responsibility pattern for it

  • @gaddamramakrishnasivaprasa1618

    @gaddamramakrishnasivaprasa1618

    3 ай бұрын

    you can use strategy pattern and pass the operation as input

  • @prajwalbhusari8299
    @prajwalbhusari8299 Жыл бұрын

    Sir, please post more videos on design patterns🙏

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Sure

  • @heenakalra2477
    @heenakalra24773 ай бұрын

    I can see that u have made some of the imp questions like parking lot and car rental system paid. I don't think everyone can afford it especially the students.

  • @DeepakLalchandaniProfile
    @DeepakLalchandaniProfile Жыл бұрын

    How to handle incoming millions of user requests for a e commerce application ? If you have source code,please share

  • @UtkarshGupta-hp3nm
    @UtkarshGupta-hp3nm Жыл бұрын

    I got confusion in between adapter and composite design(i.e Object inside object) since adapter also follow the same thing (i.e. creating new class that extends previous class ) hence at run time object inside object

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    HI Utkarsh, have you seen adapter pattern video too?

  • @UtkarshGupta-hp3nm

    @UtkarshGupta-hp3nm

    Жыл бұрын

    @@ConceptandCoding yes there you told like wrapping the existed class with new class and user will call the new created class for their desired output ... If I am wrong correct me

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    @@UtkarshGupta-hp3nm Okay Utkarsh, after office. I will clarify your doubts regarding both. we can talk for some time in evening and hope you will get more clarity

  • @suheabkhan2546
    @suheabkhan2546 Жыл бұрын

    The video is excellent.... Can u please do a detailed video with code for parkinglot ... The code for parkinglot in ur playlist is not updated

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    sure.

  • @suheabkhan2546

    @suheabkhan2546

    Жыл бұрын

    Thanks, u deserve much more appreciation... Ur videos on lld are helping me like anything

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    @@suheabkhan2546 thanks a lot Suheab

  • @suheabkhan2546

    @suheabkhan2546

    Жыл бұрын

    @@ConceptandCoding Also sir, if u can make a video on lld video on these could be great :- 1) Zomato/ food delivery app 2)Netflix/online streaming website 3)true caller 4)Uber

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    @@suheabkhan2546 its in my bucket list buddy, slowly going towards it. :)

  • @tangypotato1
    @tangypotato1Ай бұрын

    Is this playlist relevant for a fresher or are there some topics that can be left as i am low on time .

  • @ConceptandCoding

    @ConceptandCoding

    Ай бұрын

    ita for freshers too

  • @himanshupoddar1395
    @himanshupoddar1395 Жыл бұрын

    None of the youtube tutorial provide example of what's the problem and how the same can be solved with composite design pattern. Everyone just starts with the pattern directly. Its really not useful for most of the beginners. Thanks for this explanation

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Umm not sure, i tried to explained the problem with different example. We can discuss more if it's not clear buddy

  • @himanshupoddar1395

    @himanshupoddar1395

    Жыл бұрын

    @@ConceptandCoding sorry if I was not clear, I have mentioned that "Thanks for this explanation" which means this video does explain the problem and solution for both.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Cool thanks buddy, i thought in a scarcity manner you said :)

  • @venkatajagannath6014
    @venkatajagannath6014 Жыл бұрын

    can you please start HLD series too ?

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    I think you haven't seen the HLD playlist. Kindly check it out High Level Design from Basics to Advanced: kzread.info/head/PL6W8uoQQ2c63W58rpNFDwdrBnq5G3EfT7

  • @premium3968
    @premium3968 Жыл бұрын

    Are all structural design pattern follow same object inside object methodology?? Like in ur proxy, decorator pattern also same object was inside same class which have is a and has a relationship!!!? Its confusing plz help?

  • @rajaryan7566
    @rajaryan7566 Жыл бұрын

    first two min me dp vali feel aai, object inside object=> subproblem?? lets continue the video

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    :)

  • @himanshuchhikara4918
    @himanshuchhikara4918 Жыл бұрын

    Thank you very much for creating such a beautiful LLD playlist.

  • @ConceptandCoding

    @ConceptandCoding

    Жыл бұрын

    Glad you enjoy it!