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

preview_player
Показать описание


Tags

#designpatterns #builderpattern #lld #oops #java #lowleveldesign #lld #statepattern #vendingmachine
Рекомендации по теме
Комментарии
Автор

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.

vatsalmaheshwari
Автор

A much needed content. Very few people are there who create videos on this topic. Thank you for your initiative 😁.

rohitshaw
Автор

Riddhi, could you please share the git repo link for the same?

sarfrazz
Автор

Thank you so much, Mr. Riddhi.

Consie & Informative

fares.abuali
Автор

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.

rohitshaw
Автор

Amazing content as many of the companies are asking LLD questions in their SDE-1 (e.g - freshers) interviews.

snehomoymaitra
Автор

Very helpful video, at a time when there is a dearth of LLD resources. Thank you for making these ❣

aishwaryapani
Автор

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

Kapil_Sharma_Engineer
Автор

Can you please explain any idea on how to implement online payment in place of adding a coin .

soumyarv
Автор

I really liked the design as well as the explanation. Please create more such LLD design content👍

abhishekrai
Автор

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?

obsessiveDreamer
Автор

Where is the github url to find the code ??

Maneeshce
Автор

Great explanation! Can we use the same design pattern to design a shopping cart?

zahidkhan-lnjv
Автор

Hi, Thanks for the helpful tutorial. If possible kindly share the codebase in a repository. Regards!

divyajyotibasu
Автор

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 ?

harshraj_
Автор

need more LLD videos like this ....please

rishav
Автор

instead of throwing illegal state can we sent some warning and be on same state

tanveer.shaikh
Автор

Great explanation. Can you please share link to this code repo

nikhilk
Автор

can we get the source code link as well @Riddhi Dutta

akankshagaur
Автор

is there any github repo for this design?

pratosh