System Design Parking lot | Object Oriented Design | Code Implementation | The Tech Granth

Ғылым және технология

System Design | #SystemDesign :
Parking lot system design is a simple object oriented design question asked in Tech Interview by companies like Google, Microsoft, Amazon etc.
Complexity in design happens when we increase the number of entry and exit gates because that adds up the problem on concurrency and race condition.
Complexity gets increased with the category of parking vehicle as well, incase we have to classify them as hatchback, SUV, Sedan, bus etc.
In this video I have covered the following scenarios:
- Multilevel Parking lot
- Multiple category of parking space
- Multiple entry and exit (adds an interesting case of concurrency)
- Should not allow more vehicles than allocated space for each category
- Charge should be hourly basis
- Display available number of parking for each category at entry itself
Complete code is added in my github link mentioned below.
You can buy us a coffee at : www.buymeacoffee.com/thetechg...
system design: • System Design | Distri...
DS for beginners: • Arrays Data Structures...
leetcode solutions: • Leetcode 84 | Largest ...
github: github.com/TheTechGranth/theg...
facebook group : / 741317603336313
twitter: / granthtech

Пікірлер: 54

  • @gurudassulebhavikar
    @gurudassulebhavikar5 ай бұрын

    Wow. It covers so many important points that an interviewers looks for. Thank you so much.

  • @billionair_dreamz
    @billionair_dreamz2 жыл бұрын

    So simple and easy to understand, I watched various resources for this problem but yours is the best.. 👌👌👌

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Thanks. Glad it was helpful. Do like and subscribe and share with your friends 🙂

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

    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).

  • @kiransfitnesstips4095
    @kiransfitnesstips40954 ай бұрын

    Best explanation i ever seen... Hats off.

  • @NikhilKumar-of5gb
    @NikhilKumar-of5gb2 жыл бұрын

    Make more such videos plzzzzzz. Such a elegant code man, hats off.

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Glad it was helpful. Do like and subscribe and share with others 🙂

  • @manjunathm7632
    @manjunathm76322 жыл бұрын

    Clean and easy to understand... Thank you.

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Gald it helped. Do like and subscribe and share with your friends :)

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

    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.

  • @vyankateshkulkarni4374
    @vyankateshkulkarni43744 ай бұрын

    This is gem.. thanks :)

  • @siddharthasonker
    @siddharthasonker2 жыл бұрын

    Great job!!

  • @vikashkumaryadav1685
    @vikashkumaryadav16852 жыл бұрын

    Hi In machine coding round do we have to code the entire working model as u have done in this video?

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    No, you may be asked to come up with the base classes and implement few methods

  • @Kunal-ro8yo
    @Kunal-ro8yo3 жыл бұрын

    Great. Please make more such LLD videos

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    Thanks, hope you liked it. Do like subscribe and share it with your friends :)

  • @GoodLuck-dv2zu
    @GoodLuck-dv2zuАй бұрын

    I think scan pay should be in the ExitPanel instance. Also generating tickets and finding available spots should be inside the EntryPanel class

  • @VivekSharma-vw3do
    @VivekSharma-vw3do2 жыл бұрын

    Nice explanation , Can plz make a video on IRCTC especially the query part on diff diff scenarios .

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Glad it was helpful. I will try to come up with IRCTC design. Do like and subscribe and share with your friends :)

  • @thehotshots9032
    @thehotshots90322 жыл бұрын

    Do you work in Udaan?

  • @manojkr2362
    @manojkr23624 ай бұрын

    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

  • @goblin1390
    @goblin13902 жыл бұрын

    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

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    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.

  • @aakash1763
    @aakash17632 жыл бұрын

    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?

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    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 🙂

  • @satyaanvesh7051
    @satyaanvesh70513 жыл бұрын

    may i know what will the table base tables here we can come up with

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    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 :)

  • @9719426035
    @97194260353 жыл бұрын

    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

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    Good observation. Thanks for suggestion. Kindly check the other videos as well and share it with your friends. Really appreciate honest comment and suggestions :)

  • @AniketSomwanshi-ll7mz

    @AniketSomwanshi-ll7mz

    6 ай бұрын

    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

  • @parwana1000
    @parwana10003 жыл бұрын

    You are awesome ....

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    Really glad you liked it :)

  • @sanchitjain7204
    @sanchitjain72042 жыл бұрын

    Is it possible to come up with this design in interview setting ?

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    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

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

    How to practice LLD

  • @ankur8804
    @ankur88043 жыл бұрын

    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 :)

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    Thanks, it means a lot. I am working on that currently, will come up with it in coming week.

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    here you go, hope justice was done : kzread.info/dash/bejne/Y2h3xZqCdLradrA.html

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

    💌

  • @chrispure7461
    @chrispure74612 жыл бұрын

    Don't we need to have UML diagram before doing the coding part for LLD?

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Depends on years of experience, for more experienced candidates, interview revolve more around design and uml

  • @bruvhellnah

    @bruvhellnah

    2 жыл бұрын

    @@TheTechGranth What does the interviewer expect in lld rounds in case of less experienced candidates?

  • @jeevteshsingh899
    @jeevteshsingh8992 жыл бұрын

    besttttttt

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    Glad it was helpful. Do like and subscribe and share with others 🙂

  • @ankur8804
    @ankur88043 жыл бұрын

    Can you make lld on elevator pls

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    yes sure. Do like the video and subscribe to the channel and share it with your friends :)

  • @ankur8804

    @ankur8804

    3 жыл бұрын

    @@TheTechGranth sir pls make elevator, it is very much needed Thanks

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    @@ankur8804 yes I will come up with it soon. I am getting a lot of comment regarding this lld

  • @TheTechGranth

    @TheTechGranth

    3 жыл бұрын

    here you go, hope justice was done : kzread.info/dash/bejne/Y2h3xZqCdLradrA.html

  • @goblin1390
    @goblin13902 жыл бұрын

    Please share this whole code

  • @TheTechGranth

    @TheTechGranth

    2 жыл бұрын

    It is already added on my GitHub, link is there in description 🙂

Келесі