Could you please tell me apart from the Singleton pattern what other patterns you have used here? plz plz. Also, could you please add these details to all your future videos? I really like the way you explained the Logging Framework System design video where you have added all design patterns details too which you have used in code (LLD).
On top of my head, all the pojo can be directly converted to simple tables, you can have table to persist a parking lot which can have name, description and address, if you are planning to have multiple parking lots you can normalize this table. there will be a table for floors which can store an id , parking lot id, number of slots, number of free slots etc. a table for parking slot which will store id, parking slot type, floor id, isOccupied etc., you need a transaction table to store the tickets issued and pricing, so this can have ticketid, slot type,entry time, exit time, cost etc. add something if I am missing :)
getInstance() method of ParkingLot class is not thread safe, so in case if more than 1 threads trying to access the object at the time of Lazy loading this could create the issue.
You should have used stack to keep track of empty slotsfor each packing slot type per floor rather than iterating on all list of all parking slot type for a floor and once its free pop it back to stack.Complexity will be O(1) which is O(N) in your implementation
Good observation. Thanks for suggestion. Kindly check the other videos as well and share it with your friends. Really appreciate honest comment and suggestions :)
It's fine for in-memory projects. It won't translate to a backend application with database persistance. There is no stack in databases. Still good for in memory applications
Nice explanation. But as per the SOLID principle we should assign only one responsibility to a class. Don't you think ParkingLot class has more content and we can further divide it into 2 classes. Please let me know how we can assign that ticket assigning responsibility to other class and use it here
One way will be to create a class which will deal with tickets and compose ticket assignment to parking lot, it will be easier to implement if you are using springboot and use injection of bean.
Great Video just one request related to concurrency I didn't get too much idea how to handle concurrency issue if there is one instance of multiple instance this issue will not be for the LLD it can be question for other LLD how to handle concurrency. Could you please make a video on how to handle concurrency issue?
There is one way for larger application which I have discussed in BookMyShow system design. You can check it out in playlist for high level design. Do let me know if you need further clarification 🙂
Wow. It covers so many important points that an interviewers looks for. Thank you so much.
Best explanation i ever seen... Hats off.
How this parking lot be designed using micro services & provide this parking lot as Saas product?
Could you please tell me apart from the Singleton pattern what other patterns you have used here? plz plz. Also, could you please add these details to all your future videos? I really like the way you explained the Logging Framework System design video where you have added all design patterns details too which you have used in code (LLD).
Really helpful. Thanks for your efforts.
Just had a small doubt, why are the addVehicle and removeVehicle methods protected?
So simple and easy to understand, I watched various resources for this problem but yours is the best.. 👌👌👌
Thanks. Glad it was helpful. Do like and subscribe and share with your friends 🙂
Hi
In machine coding round do we have to code the entire working model as u have done in this video?
No, you may be asked to come up with the base classes and implement few methods
may i know what will the table base tables here we can come up with
On top of my head, all the pojo can be directly converted to simple tables, you can have table to persist a parking lot which can have name, description and address, if you are planning to have multiple parking lots you can normalize this table. there will be a table for floors which can store an id , parking lot id, number of slots, number of free slots etc. a table for parking slot which will store id, parking slot type, floor id, isOccupied etc., you need a transaction table to store the tickets issued and pricing, so this can have ticketid, slot type,entry time, exit time, cost etc. add something if I am missing :)
I think scan pay should be in the ExitPanel instance. Also generating tickets and finding available spots should be inside the EntryPanel class
Make more such videos plzzzzzz. Such a elegant code man, hats off.
Glad it was helpful. Do like and subscribe and share with others 🙂
Clean and easy to understand... Thank you.
Gald it helped. Do like and subscribe and share with your friends :)
Is it possible to come up with this design in interview setting ?
Base structure of class is expected, may be implementation of a method or 2 can be asked if structure is finalized and there is still some time
Can you make lld on elevator pls
yes sure. Do like the video and subscribe to the channel and share it with your friends :)
@@TheTechGranth sir pls make elevator, it is very much needed
Thanks
@@ankur8804 yes I will come up with it soon. I am getting a lot of comment regarding this lld
here you go, hope justice was done : ua-cam.com/video/14Cc8IDWtFM/v-deo.html
i am unable to understand the code . what should i do now .help me give any other resource to understand the basic level of low level design
getInstance() method of ParkingLot class is not thread safe, so in case if more than 1 threads trying to access the object at the time of Lazy loading this could create the issue.
You should have used stack to keep track of empty slotsfor each packing slot type per floor rather than iterating on all list of all parking slot type for a floor and once its free pop it back to stack.Complexity will be O(1) which is O(N) in your implementation
Good observation. Thanks for suggestion. Kindly check the other videos as well and share it with your friends. Really appreciate honest comment and suggestions :)
It's fine for in-memory projects. It won't translate to a backend application with database persistance. There is no stack in databases. Still good for in memory applications
Nice explanation. But as per the SOLID principle we should assign only one responsibility to a class. Don't you think ParkingLot class has more content and we can further divide it into 2 classes. Please let me know how we can assign that ticket assigning responsibility to other class and use it here
One way will be to create a class which will deal with tickets and compose ticket assignment to parking lot, it will be easier to implement if you are using springboot and use injection of bean.
How to implement multiple parking entries and multiple exits..
Great Video just one request related to concurrency I didn't get too much idea how to handle concurrency issue if there is one instance of multiple instance this issue will not be for the LLD it can be question for other LLD how to handle concurrency. Could you please make a video on how to handle concurrency issue?
There is one way for larger application which I have discussed in BookMyShow system design. You can check it out in playlist for high level design. Do let me know if you need further clarification 🙂
Don't we need to have UML diagram before doing the coding part for LLD?
Depends on years of experience, for more experienced candidates, interview revolve more around design and uml
@@TheTechGranth What does the interviewer expect in lld rounds in case of less experienced candidates?
This is gem.. thanks :)
Do you work in Udaan?
Nice explanation , Can plz make a video on IRCTC especially the query part on diff diff scenarios .
Glad it was helpful. I will try to come up with IRCTC design. Do like and subscribe and share with your friends :)
How to practice LLD
Great. Please make more such LLD videos
Thanks, hope you liked it. Do like subscribe and share it with your friends :)
Can you pls make video on elevator lld as it is not present anywhere on Internet.
Big request, can you please make it quickly
Thanks
Your big fan :)
Thanks, it means a lot. I am working on that currently, will come up with it in coming week.
here you go, hope justice was done : ua-cam.com/video/14Cc8IDWtFM/v-deo.html
You are awesome ....
Really glad you liked it :)
Great job!!
Please share this whole code
It is already added on my GitHub, link is there in description 🙂
💌
besttttttt
Glad it was helpful. Do like and subscribe and share with others 🙂