Your low level design videos helped me to clear Amazon SDE-2 interviews :) Just got verbal confirmation they are going with L5., Waiting for offer letter. Very underrated channel.
@SoumyajitBhattacharyay4 жыл бұрын
Thats so awesome!!! It is really great to see that it helped you ❤. Do share it among your friends as well it will help the channel a lot! ❤❤
@akki_gamingzone2 жыл бұрын
Did you got the offer?
@ronitroy31742 жыл бұрын
What package
@rishav1442 жыл бұрын
@@ronitroy3174 amazon sde2 band is around 75 LPA ( base pay 38 Lacs/ year)
@SoumyajitBhattacharyay2 жыл бұрын
Not true. Even 1.5 year experience guys who are getting promoted, get a base of 40+ This is old data though.
@ryan-bo2xi3 жыл бұрын
Not many have the skill to teach,you are blessed with one. I wish you all the best brother.
@MacTavish2208Ай бұрын
Learnt a lot from this video and got clarity on what I should focus on during the interview. Thanks for this amazing video. I have some doubts - (Here I'm assuming that prebooking is not allowed. You can only book the spot on the entry gate ) 1. I think that isParkingSpaceAvailableForVehicle should not be in Parkinglot class. The logic to find available spot may vary (time based search / vehicle type based search) so it'll violate the single responsibility principle and won't be scalable. 2. ParkingFloor object has a isFull boolean. But the parking lot can be full for a particuar vehicle type and can be available for another vehicle 3. 10:51 - I think Admin extends Account doesn't make sense. extends means "is-a" relationship. Admin is not an account instead Admin has account. So either use composition or Account class should be named as User. Although he mentions that Admin is a type of account. Probably renaming Admin to AdminAccount makes more sense. (Admin sounds like a person) 4. VehicleType and PaymentType should be abstract class rather than enums. 5. For ParkingDisplayBoard, mentioning observer design pattern can give extra points. Let me know your thoughts.
@ritwikapal9656 Жыл бұрын
This is the best parking lot lld video, most comprehensible and logical.
@ankush3634 жыл бұрын
Much awaited video bro. Referred your videos to three other friends and they are also impressed by your work. Thanks you so much for the great content.
@SoumyajitBhattacharyay4 жыл бұрын
Thanks so much!! Really appreciate the feedback!! Keep supporting tgr channel!. Any other video suggestions??
@ankush3634 жыл бұрын
@@SoumyajitBhattacharyay Elevator LLD.
@barishkhandelwal87577 ай бұрын
One input from my side: at 3.22 min timestamp, when you define API is ParkingSpaceAvailableForVehicle, instead of boolean return ,I think we should return List floors where parking is available
@ruchirsharma57233 жыл бұрын
You are a hidden diamond sir. Thank you!!!
@SoumyajitBhattacharyay3 жыл бұрын
Glad you feel this way
@biswaMastAadmi Жыл бұрын
This is the best LLD series, other channels wear make up and talk non sense.
@shashankmittal88204 жыл бұрын
Aren't we breaking the Open Close Principle while adding Enums in the System? For Example, You have PaymentType as Enum, and suppose a new PaymentType is added in the future, you will have to modify the makePayment method of the Payment Class to take care of that. Instead, we can have a PaymentType as an Interface and Concrete classes like UPI, Credit Card, etc. having a payment method. @Soumyajit Bhattacharyay Please share your views on this.
@JanaManaRana3 жыл бұрын
This makes sense. Enum should only be used if you know the states are final.
@buildleadinnovate243 жыл бұрын
well said
@aditigupta68709 ай бұрын
@shashankmittal8820, can you explain that how if we add new enum values in PaymentType, the makePayment() in Payment class will fail?
@vasudevjamwal4 ай бұрын
@@aditigupta6870it wont fail. But you’d have to make changes in the original code, which would be something like adding an extra IF ELSE statement. The idea being discussed here is on the lines of strategy design pattern, which I think is a better fit. EDIT: Enums for cases like the parking status should be okay. I think adding some other design pattern there, from the beginning, would be over engineering
@curious_catx3 жыл бұрын
watching your videos before my LLD interview. Hope it goes well.
@SoumyajitBhattacharyay3 жыл бұрын
All the best for your interviews
@harshil3384 жыл бұрын
Hello Soumyajit. Great content!! For the next video can you make LLD for elevator design, as that is also a pretty popular question
@SoumyajitBhattacharyay4 жыл бұрын
Thanks for the feedback!! Surely i will do that as well!! The elevator design can take a wide variety of different use cases. Will try to cover as much as possible!
@Thepankaz13 жыл бұрын
It would be great if you can also give a rough call flow of APIs in different scenarios, since i see lot of duplicate methods like for payment, cost etc. and not sure how they all will be called. Thanks.
@Abhisheksaharn3 жыл бұрын
Agree. API flow will help understand more better. Like connecting dots at the end.
@shivshaktipandey71482 жыл бұрын
@@Abhisheksaharn you can watvh him then @udit agarwal
@amitagrawal46604 жыл бұрын
Very nicely explained and in a much simpler manner as compared to other resources available.
@rahulsharma50304 жыл бұрын
Video is nice.But I have your code 2-3 times and there are some questions i would like to ask: 1. There are functions to generate ticket and process payment at "Parking Attendant" class and at "Gate class". It is not clear what is difference between these two. 2. I dont see need of parking ticket in payment info. Parking ticket "has" payment info or payment receipt. 3. Why do you need display board? All we need to know whether space is there or not.Since we got ticket at entry only ,it means we know where to park our vehicle. Now what will display board data help in any way?If you say, that we will get ticket and we can park at any free spot, then it is not an automated system that we are building at first place. My thoughts for point 1 :There should be a ticketService, which can generate ticket,process payment for a ticket, and it maintains info like, which slots are free and occupied,and talks to parking lot to get this info. Now on booking ticket,slot status change and on payment process slot status change, this service will handle all those stuff, and it can be called from gate or from parking attendant. Update code : ideone.com/gQl4ah
@rahulsharma50303 жыл бұрын
@Mohammad Kaif yeah u are correct
@Sandeepg2553 жыл бұрын
doesnt it seems a bad idea to keep processVehicle and processPayment inside parkingAttendant class ? because lets say a parking attendant at one of the exit gates might processVehicleEntry by mistake , i think ParkingAttendant can further be inherited to EntryParkingAttendant and ExitParkingAttendant and those 2 functions will be divided into each one of them. Or if we go by your approach then in proceesVehiclEntry and processPayment the ParkingAttendant object also needs to be passed in order to handle such erroneous requests within those 2 functions only and return false. thoughts ? at 12:57
@kunal43504 жыл бұрын
Thanks for sharing . My sincere request , please make video on - Design Logging Module which can be imported in any client application Thanks soumyajit
@rameshsapphire79453 жыл бұрын
Very Good Explanation! and one doubt! Don't we need to write code for the functions we have declared in the LLD round?
@tukeshwarbhardwaj6221 Жыл бұрын
I strongly suggest to have a UML diagram to represent the relatonship between classes, that will make you solution easy to visualize and language agnostic.
@VinayListenMe Жыл бұрын
For those who are preparing for the interview, this is reqlly good stuff but not enough to face interview, there would be counter question, how concurency ia achieved, how things are updated etc.
@johncenakiwi2 жыл бұрын
Hi Soumyajit Thanks for making this video. It is really helpful. In a 1 hour LLD round, what should we focus on more? Defining the models itself takes up a lot of time. What is the interviewer looking for exactly? In this design, is there any design pattern we could use? I am new to this and it would be really helpful if you reply. 😄
@MegaAkash1234562 жыл бұрын
It's very easy to write classes, interfaces, and enums. There should be implementation of key API's and some client code calling these API's/methods to show the interaction.
@SoumyajitBhattacharyay2 жыл бұрын
True. But that is generally not the expectation out of the LLD round. However, same will be the expectation out of a machine coding round.
@gopikrishnaks96645 ай бұрын
Thank you so much for the efforts! Had a small doubt, could you please check? Why Vehicle has both classes PaymentInfo, ParkingTicket? It can just have PaymentInfo as ParkingTicket is already present in it? Similarly, amount need not be present in PaymentInfo as it is already present in ParkingTicket I think.
@rajdeepmajumder46974 жыл бұрын
I was looking for this design. Thanks a lot and by the way aj KKR jitche😊
@SoumyajitBhattacharyay4 жыл бұрын
Thanks for the feedback!! Aajke KKR hope so jete!! :P
@anirbansaha79874 жыл бұрын
Hi Soumyajit, Couple of questions from my side . Would be grateful if you could answer them. 1) Why is there a vehicle object inside parking space class ? 2) Account class has a function addParkingFloor(ParkingLot parkingLot, ParkingFloor floor); I believe Account object will be created in the Main function (meaning client side). And to call addParkingFloor we must first create an object of Parkingfloor in client side. But should not the floor object be created inside ParkingLot class following composition rule since ParkingLot controls the lifecycle of ParkingFloor ?
@rahulsharma50304 жыл бұрын
@saha 1. when i tried to write my code, i also did not place vehicle in parking space.I am not sure if it is needed or not. 2. I too have some doubt here.Floor will be created in Parking lot only.Parking lot will expose api to add floor which, will be eventually called by admin class.
@himaninegi97582 жыл бұрын
Hey Soumyajit, Thank you for making this video. I have one suggestion, I think its better to make a payment factory class which will support different type of payment options. What do you think ?
@mishra.prateek3 жыл бұрын
Video begins at 1:56
@najimali328 ай бұрын
Still relevant in 2024. Thanks for the video.
@umangmavani75943 жыл бұрын
Just a thought. If we are collecting ticket at the entry gate, what is the use of having vacant spots display at each floor ? Isn't it contradicting ?
@sumitrairkt11 ай бұрын
I think its just for visibility on traffic for everyone present on that floor
@anirudhlok20474 жыл бұрын
Brilliant bro! Couldn't find better video than this. Waiting for more such design videos and tips, thanks a lot for great content!
@SoumyajitBhattacharyay4 жыл бұрын
So glad that you liked it. I am coming up with a series on design patterns, oops concepts and their usage!!
@divyashahi93644 жыл бұрын
Bhaiya call center, deck of cards, online chat lld videos too, please, and this video was awesome
@gauravnarang9552 жыл бұрын
Such a great explanation. Can you create one for Design elevator system? This will be very helpful as there no such good videos for elevator design.
@sauravsingh56638 ай бұрын
Great video ! I have a small doubt though. The admin class has methods like addParkingFloor(), addParkingSpace(), addParkingDisplayBoard. Isnt this class voilating the single responsibility principle ? Shouldnt we just keep admin related information in the admin class and have another class which exposes these functions as APIs and allows admin to interact with these APIs? Same thing for ParkingAttendant class.
@sanjayulsha4 жыл бұрын
In a real time interview, 1. Do we need to draw use-case diagrams? 2. And then code the complete solution or just draw class diagrams? Please clear this doubt ASAP.
@SoumyajitBhattacharyay4 жыл бұрын
Use case diagram is generally not required in an interview but is for your understanding. It will make the design process very simple. We definitely have to write the classes/interfaces and interaction between them. Whether or not you have to implement some portion will depend on the interviewer
@rahulsharma50304 жыл бұрын
@@SoumyajitBhattacharyay do we need to draw class diagram.Do we need to learn UML stuff like composition,agreegation.If we are comfortable with writing code template with min. required use cases as you did, then do we need to focus on how to draw these things in class diagram with UML notations??
@SoumyajitBhattacharyay4 жыл бұрын
Not in an interview. You can directly jump to thinking about design clases. But in the job, definitely uml, sequence diagrams etc. Need to be drawn.
@rahulsharma50304 жыл бұрын
@@SoumyajitBhattacharyay thanks for quick reply:)
@noob9897 Жыл бұрын
No UML Diagrams??
@aditigupta68709 ай бұрын
Hi soumyajit, can you design a task scheduler, will really help just like your other videos
@rahulagrawal36114 жыл бұрын
Hi @Soumyajit, (Just to get your input) As ParkingAttendant at Entry doesn't have to do payment processing but only exit ParkingAttendant has to. Here Payment is accessible to all ParkingAttendant, so would it be better to have two separate entity as EntryAttendant and ExitAttendant where EntryAttendant has ability to only processVehicleEntry and ExitAttendant can processPayment ? (as an improvement?)
@rahulsharma50304 жыл бұрын
@Rahul Parking attendent can sit at entry gate sometimes and exit gate sometimes, what you suggested is too contrained.
@ViragJainimhere Жыл бұрын
Try to make interfaces also along with classes ..
@TechVirenPro3 жыл бұрын
Nice Work Dude..it would be cherry on top if uml diagram also there..
@rashiverma82593 жыл бұрын
explaining only this much of code will be enough for the interview?
@VinayListenMe Жыл бұрын
Why did you keep the vehicle object inside parkingSpace class?? It doesn't look more granular code in this case.
@ssidhu4 жыл бұрын
Wow very nice. More of these please :)
@rajatsingh4286 Жыл бұрын
How to solve concurrency issue ? If 2 Vehicles are entering at same time from 2 different Gates, then how to assure that same parking spot will not be allotted to them And also, what should be the algorithm to find best parking spot for each incoming Vehicle
@deepkiran7249 Жыл бұрын
Will parkingTicket not have vehicle NUmber? How can parkingAttendant validate that the ticket belongs to the owner?
@aditigupta68709 ай бұрын
Hi, we have the same method in Payment as well as ParkingAttendant class, which takes as input ParkingTicket, PaymentType and returns PaymentInfo, I think we shouldnt have a new Payment class with this method, because Payment object is anyways inside the ParkingAttendant class, and ParkingAttendant class has the same method already, instead in Payment class we can have other core functionalities of handling payment securities etc.
@VikashKumar-by2sx3 жыл бұрын
Very helpful video
@shibiliareekara68823 жыл бұрын
Thank you so much for the great content ❤️
@SoumyajitBhattacharyay3 жыл бұрын
No problem at all
@ananyabanerjee23564 жыл бұрын
Ato vlo contain akn vabchi agay subscribe korlay aro agay onk kechu jantay partam.
@AbhishekKumar-yv6ih4 жыл бұрын
When you explain I understand, but it looks very complex. How to come up with such clear design?
@SoumyajitBhattacharyay4 жыл бұрын
Hi abhishek! Thanks for the feedback. The key to any LLD is that you need to be able to visualise the problem clearly. In my previous videos i have shown what needs to be done to be able to come up with these designs. In short first properly define the requirements. Believe me this is the most important step. After that, come up with a use case diagram containing major actors in the design and then translate the use case diagram to class design. You can go through the playlist to get a sense of it. I will be adding a lot more.
@AbhishekKumar-yv6ih4 жыл бұрын
@@SoumyajitBhattacharyay Thank you so much for explaining. I will go through your entrie playlist. Are you also planning for hld(and db schema) or some good resources for the same in your opinion?
@nirmalm804 жыл бұрын
Thanks a lot for the great video
@GauravKawatrakir4 жыл бұрын
What if required to provide nearest parking spot from entrance and have multiple entrances? // 100 parking spots are divided 25 each into 4 different entrances. // PriorityQueue is use for min heap because min heap provide smallest distance from entrance to most nearest parking spot and distances increases 2nd most nearest // parking spot......and so on.... Map entrance_1 = new HashMap(); Map entrance_2 = new HashMap(); Map entrance_3 = new HashMap(); Map entrance_4 = new HashMap();
@neeleshmohanty73802 жыл бұрын
Please make a video on uber
@absimaldata2 жыл бұрын
Why the makePayment and getTicket APIs are not in some other service, why it is in EXITGATE Object? Like PaymentService at the service level, is it necessary to put API methods in individual objects instead of defining classes at the Service level (IN MVC type of Architecture) ?
@aakashchandwani2934 жыл бұрын
So Attendant would be for whole parking lot or at each parking floor ?
@AbhishekKumar-yv6ih4 жыл бұрын
Do we have to write database schema also for lld?
@SantoshKumar-bu2qr3 жыл бұрын
bhai pleas add concurrency while assigning a slot, grokking the system design on educative has much more depth
@tekbssync57273 жыл бұрын
can you provide codes of all your LLD videos in C++ also It would be very helful , or can you suggest some websites from where I can get C++ implementations of the same.?
@rahulsharma50304 жыл бұрын
suggestion : Your image is coming over code and some parts like 11:08 are not visible clearly.
@SoumyajitBhattacharyay4 жыл бұрын
True! I must have missed it while editing. Will make sure to rectify this as much as possible in the future. But sometimes it becomes un avoidable though! ☺
@AnkurGandhi84892 жыл бұрын
Please upload the lld videos for elevator and splitwise
@TheBehknqux3 жыл бұрын
Shouldn't PaymentInfo contain a payment method as well?
@whythinktmch3 ай бұрын
So no design pattern is used here?
@akakop Жыл бұрын
what about the DB schema?
@rahulsharma50304 жыл бұрын
next request: Linkedin or Facebook Design:)
@SoumyajitBhattacharyay4 жыл бұрын
Sure low level or high level?
@rahulsharma50304 жыл бұрын
We need both:). I think you can first complete Low level playlist and then start on high level designs.
@rahulsharma50303 жыл бұрын
@Mohammad Kaif yeah payment is not complete. Bare mini. we should have a payment class which has some api like payViaCard(CardDetails,amount) or payViaUIP(upid,amount), obviously there will be better designs than what I told, but in video its incomplete,he should have left it instead of putting like this.I also got confused earlier.
@rahulsharma50304 жыл бұрын
can u tell what is difference betweeen extry gate getParkingTicket() fxn and ParkingAttendent processVechicle() api, who will be called when and how these differ?Once returns bool and one parking ticket,but what is the exact flow to enter a vehicle?And why exit gate dont have payment if it has ability to process payment?
@aryanyadav3926 Жыл бұрын
But you haven't implemented the functions, is that alright?
@saurabhav42024 жыл бұрын
Awesome explanation! Can you please cover graph networks and location based apps LLD/HLD! Will most definitely be tuning in for updates
@SoumyajitBhattacharyay4 жыл бұрын
Surely i will cover. Recently in one of my interviews i was asked about the hld of yelp, which is a location based app. Will try and make a video around it!
@saurabhav42024 жыл бұрын
That'll be awesome!
@PradeepSingh-vm1gl3 жыл бұрын
@Soumyajit Bhattacharyay Do we have a class diagram or Flow diagram of it. That will be so helpful. If somebody has this please reply.
@rahulsharma50304 жыл бұрын
Some points that were not clear : 1. Why do we need display boards on all floors?When a vehicle enters,i suppose system will auto assign a space to it.SO who will be using this display boards for reading?If a car enters,it has a spot assigned ,what the board shows in each floor, how is it useful? 2.I think payment should be and abstract class and with multiple implementation like credit card,debit,upi etc. implementing it.Just passing debit card as a type to payment method,it is not able to process without debit card details. 3.I dont see any use case of putting payment info in vehicle.Vehicle has number and parking ticket. Is it a sort of bill for a parking ticket?
@SoumyajitBhattacharyay4 жыл бұрын
Every level should have a display board because as there are multiple entry points and multiple exit points, think of a scenario where there are entry and exit points present at each of the levels, in that case the display board will be displaying the information gor that level and the driver along with vehicle can decide to skip larking at that level if there isnt any space available etc. That is exactly how it will be implemented. I had decided not to add the inplementation of the payment module here itself as it can by itself be a whole another beast. The paymentType enum will be used to generate the appropriate object from the factory that will return cc/dc/upi etc. Implementation object which will then itself trigger its flows. Since thats a separate system al to gether decided to abstract it here. Probably can take up the payment systems in a separate video? What say? Payment info is being put along with parking ticket inside the vehicle to madel the real life scenario where a copy of the parking ticket is given to the driver/vehicle at the point of entry. Since the vehicle has a parking ticket and an associated payment info with it I have added it inside the vehicle class itself
@rahulsharma50304 жыл бұрын
@@SoumyajitBhattacharyay cool.Its fine.There are lot of requirements to cover in one question only.And it is better that we restrict ourself to min. stuff that we can provide.I understood now.Thanks.And yes,if you can take up payment in a more details in next LLD video or may be a as a separate entity only in a single video,it would be great and the functionality will be same for payment everywhere. But payment bean for credit card/debit card etc. will be different for different customers,so I dont know whether factory method will be a good fir there.Is it a good idea when factory class has argument constructor with type of card and details of card like debit/credt/upi etc. and then create a new payment object from that everytime.I thought like payment as a abstract class and the child are debit/credit card as its implementation and then we can pass object of abstract payment and this it can be processed.
@SoumyajitBhattacharyay4 жыл бұрын
Yes i was also thinking of the same!. Will try and come up with a good design and shoot the video. Currently done with the shoot for stack overflow LLD! Stay tuned for that
@rahulsharma50304 жыл бұрын
@@SoumyajitBhattacharyay one more point i want to add is that parking board ,if it is at every floor, then it should display the entire lot info and not the current parking floor info.Because you can enter from any entry then the parking floors are inter connected mostly and we should inform person ,like which floor he/she can go to park as per space on board.let us say person sees only current floor info and he sees full and he did not enter and possibility is that other floor has space available.
@sachin_getsgoin3 жыл бұрын
The LLD is ok for freshers. Just defines entities. In an actual interview for experienced candidates - you need to think about concurrency and write code snippets for critical design decisions.
@SoumyajitBhattacharyay3 жыл бұрын
This was the case for SDE2 interviews for all the firm's I have interviewed for. Be it Indeed, twilio, Amazon, media net inmobi etc. And I have gotten offers from all of them. So this holds true even for experienced hires at the SDE 2 level. This is what was expected in their interviews. Mostly, class design, ApI design, database design and small algorithmic implementation. 🙂
@abhishekshahane4056 Жыл бұрын
Can anyone tell me how to run this code and where...I don't know about this..
@diljitprramachandran1329 Жыл бұрын
completely wrong, this is an exactreplica of the answers you will find online. However a real world system low level design for a parking space app will not be somewhere identical to this.
@74N3 жыл бұрын
Just want to know wether you are a fan of Sunil Narine or not. Expecting a reply 😅
@soumyajitsaha39394 жыл бұрын
Kkr💙💙💙💙💙
@SoumyajitBhattacharyay4 жыл бұрын
Hahah vut this season was a little dissapointing :'(
@soumyajitsaha39394 жыл бұрын
Yes, but 'korbo lorbo jitbo'
@Yeswanth223 жыл бұрын
Hello all , can some one throw some some light on how the interaction between processPayment of ParkingAttendant and payParkingBill of Exit gate happens
@it_is_me34043 жыл бұрын
can you please give this program in python language...
@himanijain35733 жыл бұрын
online food delivery system please
@lovleshbhatt77973 жыл бұрын
Too much for digest to me, I need ENO seriously to digest this. 😅😅😅
@jawwadakhter5261 Жыл бұрын
Not at all good, bro you are just reading the code and explaining like some presentation. Even we know how to read a code. You should rather explain how to approach.
@SurajSharma-sr1yf2 жыл бұрын
Fake accent
@meme_engineering45212 жыл бұрын
abbe dheere bol le bhai thoda
@kaushiknandula2 жыл бұрын
@here anyone working on/ Worked on python implementation of the same ? Need help ! Very Urgent. Thanks in Advance!