Тёмный

Design a Vending Machine | LLD Interview Question | State Design Patterns | OOPS | Java 

Riddhi Dutta
Подписаться 79 тыс.
Просмотров 19 тыс.
50% 1

🔴 Check out Geeks for Geeks System Design Course : bit.ly/3tZ4wnm
🔴 Connect with me on Instagram - / code.blooded.voyager and ask me doubts 1:1. Would try to reply to each one of you.
🔴 Builder Design Pattern Explained : • Understanding Builder ...
🔴 Decorator Design Pattern Explained : • Decorator Design Patte...
🔴 Amazon SDE Revision Sheet : • Video
🔴 Join My Telegram Channel for Placement Updates and attend my Free Live Classes on DS Algo - telegram.me/riddhi_dutta
🔴 Connect with me on LinkedIn - / riddhi-dutta
🔴 Graph Placement Series From Scratch - • Graphs - The Ultimate ...
🔴 Link to my TopicWise SDE Sheets Playlist : • Trees SDE Coding Probl...
Tags
#designpatterns #builderpattern #lld #oops #java #lowleveldesign #lld #statepattern #vendingmachine

Опубликовано:

 

23 июн 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 70   
@vatsalmaheshwari692
@vatsalmaheshwari692 Год назад
I believe that this does not fulfill Interface Segregation principle of SOLID principles. There is no need of insertCoin and presButton in some cases. We should make different interfaces if any state does not want to implement a function. Tell me if I am wrong. I would love to get corrected.
@aishwaryapani4662
@aishwaryapani4662 2 года назад
Very helpful video, at a time when there is a dearth of LLD resources. Thank you for making these ❣
@fares.abuali
@fares.abuali 2 года назад
Thank you so much, Mr. Riddhi. Consie & Informative
@rohitshaw6862
@rohitshaw6862 2 года назад
A much needed content. Very few people are there who create videos on this topic. Thank you for your initiative 😁.
@rite2riddhi
@rite2riddhi 2 года назад
Pleasure
@debmalyapan53
@debmalyapan53 2 года назад
this was highly required. thanks da.
@zahidkhan-ln3jv
@zahidkhan-ln3jv Год назад
Great explanation! Can we use the same design pattern to design a shopping cart?
@snehomoymaitra9317
@snehomoymaitra9317 2 года назад
Amazing content as many of the companies are asking LLD questions in their SDE-1 (e.g - freshers) interviews.
@rite2riddhi
@rite2riddhi 2 года назад
Thank you ❤️
@vinamrasangal8436
@vinamrasangal8436 17 дней назад
how can a person write such a big LLD code in just 1 hr ???
@abhishekrai5212
@abhishekrai5212 Год назад
I really liked the design as well as the explanation. Please create more such LLD design content👍
@rite2riddhi
@rite2riddhi Год назад
Thanks abhishek
@rishav144
@rishav144 2 года назад
need more LLD videos like this ....please
@nikhilk4735
@nikhilk4735 Год назад
Great explanation. Can you please share link to this code repo
@namantyagi6294
@namantyagi6294 2 года назад
In an actual lld interview, do we need to write the whole methods and class or just a skeletal design with the classes and methods just declared and not completely implemented?
@rite2riddhi
@rite2riddhi 2 года назад
Depends. In an lld interview , important functions you have to write. For machine coding , you have to write everything.
@obsessiveDreamer
@obsessiveDreamer 2 года назад
Are you passing the object of the vending machine into all three states' constructors as a reference or a copy of the object? I mean all three states is working on the same instance of vending machine?
@rite2riddhi
@rite2riddhi 2 года назад
Right.
@sudipasarkar7981
@sudipasarkar7981 2 года назад
Amazingly explained much needed one😃😇
@rite2riddhi
@rite2riddhi 2 года назад
Thank you
@dopamine003
@dopamine003 9 месяцев назад
Great explanation
@email4pranav
@email4pranav 2 года назад
Hey could you upload this code to a GitHub repo?
@tanveer.shaikh
@tanveer.shaikh Год назад
instead of throwing illegal state can we sent some warning and be on same state
@chodingninjas7415
@chodingninjas7415 Год назад
Great stuff
@divyajyotibasu3001
@divyajyotibasu3001 8 месяцев назад
Hi, Thanks for the helpful tutorial. If possible kindly share the codebase in a repository. Regards!
@rohitshaw6862
@rohitshaw6862 2 года назад
Also can you please wrap the whole content in single playlist, so it will be easier for me to track all the videos. Thank You.
@rite2riddhi
@rite2riddhi 2 года назад
Sure
@chetanpareek4428
@chetanpareek4428 29 дней назад
​@@rite2riddhi can you please provide the gjithub link of this code ?
@sarfrazz34
@sarfrazz34 Год назад
Riddhi, could you please share the git repo link for the same?
@chetanpareek4428
@chetanpareek4428 29 дней назад
@Riddhi could you please share the github link of this code ?
@harshraj22_
@harshraj22_ 2 года назад
It's kind of strange that states need vending machine to initiate, and vending machine meeds states. Looks like a kind of circular dependency, and becomes more confusing when you think composition in terms of " class has a" property. Also, taking out inventory instance out of vending machine class, and performing operations on it doesn't sound quite good to me. Wouldn't it be more better if vending machine rather exposes some methods to operate on inventory, rather than giving off its internal objects to outsiders ?
@rite2riddhi
@rite2riddhi 2 года назад
For 2 , yes have added addProductToInventory() in the Vending Machine itself. User will only interact with VM. I focussed on the main problem , hence skipped few things. For 1 , it won't be a cyclic dependency. Again , as I said no design is perfect , and it is not possible to come up with a flawless design in a 1hr interview.
@Kapil_Sharma_Engineer
@Kapil_Sharma_Engineer 2 года назад
Small doubt is do we really need a State interface on which Vending machine is dependent. I feels like we can have a enum of states or a current state variable based upon that we can give the functionality output
@rite2riddhi
@rite2riddhi 2 года назад
Won't that result in a lot of if else handling? How would you achieve runtime polymorphism?
@Kapil_Sharma_Engineer
@Kapil_Sharma_Engineer 2 года назад
@@rite2riddhi yes there will be more if-else handling. And regarding polymorphism maybe I will use a strategy pattern but one this is I will give try to use the Abstract class with default function definition so that we don't need to define a function with the same functionality in multiple classes
@rite2riddhi
@rite2riddhi 2 года назад
@@Kapil_Sharma_Engineer using multiple if else might not be good for code readability. But yes , again design is an open ended discussion. 😅
@Kapil_Sharma_Engineer
@Kapil_Sharma_Engineer 2 года назад
@UCKyTTBdDH3I%F0%9F%98%87635HQMrPvz_A Completely agrees every person has their own view to look at the problem and give the solution accordingly 🙂
@iamdips00356
@iamdips00356 Год назад
Amazing video
@satyajeetkumarjha1482
@satyajeetkumarjha1482 2 года назад
Can you post the link to GitHub repo?
@JigyasaGupta-nx9pk
@JigyasaGupta-nx9pk Год назад
do u have a git hub link
@pratosh
@pratosh Год назад
is there any github repo for this design?
@hell-o8470
@hell-o8470 Год назад
where can i get the code?
@Maneeshce2007
@Maneeshce2007 10 месяцев назад
Where is the github url to find the code ??
@chiragkarnwal6740
@chiragkarnwal6740 2 года назад
Thanks sir very helpful video 😊❤️
@rite2riddhi
@rite2riddhi 2 года назад
Pleasure
@akankshagaur845
@akankshagaur845 8 месяцев назад
can we get the source code link as well @Riddhi Dutta
@raginibhadani7257
@raginibhadani7257 Год назад
Is this code available somewhere?
@vishalmishra1937
@vishalmishra1937 Год назад
plz share the code link
@sayankarmakar13
@sayankarmakar13 6 месяцев назад
It will be very helpful when you share the github link
@debmalyapan53
@debmalyapan53 2 года назад
also plz make a video on elevator, distributed cache, splitwise. 😁
@rite2riddhi
@rite2riddhi 2 года назад
Next singleton then elevator
@Lucifer-xt7un
@Lucifer-xt7un 2 года назад
@@rite2riddhi bro please maintain consistency in this series and increase frequency of making videos
@thesoftwareengineer17
@thesoftwareengineer17 Год назад
bro plz add github links for all these questions too
@kumarabhishek6777
@kumarabhishek6777 8 месяцев назад
you explain nicly but i am getting error in this ,,,, might be missing something so if possible provide the source code of the pattern
@meme_engineering4521
@meme_engineering4521 2 года назад
bhai i wanted to ask, how important is LLD for freshers? and especially for campus placements
@rite2riddhi
@rite2riddhi 2 года назад
Not that important but good to know before joining any company
@meme_engineering4521
@meme_engineering4521 2 года назад
@@rite2riddhi okay, thanks
@rakeshpramanik
@rakeshpramanik Год назад
Wow
@lokey8084
@lokey8084 10 месяцев назад
This feels like it breaks Liskov's substitution principle
@vinamrasangal8436
@vinamrasangal8436 17 дней назад
give code plz
@ManeyyNeg
@ManeyyNeg 2 месяца назад
pls share github link
@digitaljunk
@digitaljunk Год назад
To reduce echoing and delay in the recording point the microphone opening towards the sound source (your mouth). Please don't record the room space.
@rite2riddhi
@rite2riddhi Год назад
Hey this is an old recording. Sound is sorted now.
@Mukeshkrk108
@Mukeshkrk108 Год назад
sir MIke and Voice is not clear and Sir on more thing that is You talking very fast
@cj-nr5ni
@cj-nr5ni 10 месяцев назад
Dude
@user-vv4rp9uv5d
@user-vv4rp9uv5d 4 месяца назад
I guess you could have improved the design more by not create Objects of each state
@aditigupta6870
@aditigupta6870 3 месяца назад
Why are you unnecessarily violating interface segregation just to explain a state design pattern?
@ratimohan5765
@ratimohan5765 Год назад
You explain very fast, need extra effort to understand. Didn't like this tutorial.
@rite2riddhi
@rite2riddhi Год назад
Oh so sorry to hear that.. I would try to be slow from next time. You can watch it at 0.75x for now.
@no_name45689
@no_name45689 Год назад
Exactly.
Далее
У тебя проблемы?
00:20
Просмотров 590 тыс.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
10 Design Patterns Explained in 10 Minutes
11:04
Просмотров 2,2 млн
System Design Mock Interview: Design a Vending Machine
18:44