Design A Parking Garage | Google SWE Teaches Low Level Design Episode 4

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

Selling 2 parking spots - one upper level one lower level, prices vary per level, please message my only fans if interested

Пікірлер: 22

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

    I am enjoying your videos, thanks for sharing the knowledge! Content is crisp, delivery is consistent. So I don't need to change the playback speed often, which happens to be the case with many other channels!

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

    I come here after watching your video with Gaurav Sen doordash system design interview.

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

    Nice ! Question. Wouldn't priority queue array index vary based on adding/removing of other vehicles in the queue ?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Жыл бұрын

    Yeah you'll just have to change that hash entry 😭, it doesn't change time complexity

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

    enter method would also need to remove the 'location in p_queue' from parkingSportHashMap? or is it redundant?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Жыл бұрын

    That seems fair to me, though I'm not sure it's entirely necessary

  • @Rakeshkumar-po2yg
    @Rakeshkumar-po2yg10 ай бұрын

    @jordan Can you please elaborate more on parkingSpotHashMap and pQueues ? How these are defined .

  • @jordanhasnolife5163

    @jordanhasnolife5163

    10 ай бұрын

    I think the main point to realize is from each entry certain spots are more preferable, hence we need a priority queue to represent this. However there are multiple entrances, and each one is at a different location in the lot, so the rankings of spotsos different for each entrance, meaning we may want multiple different priority queues, one per entrance. Unfortunately, this means that we need to keep them in sync - to do that a hash map that points from a spot in a pqueue to the corresponding spots in the other pqueues allow us to quickly find and remove the corresponding nodes when a single spot is taken up.

  • @Rakeshkumar-po2yg

    @Rakeshkumar-po2yg

    10 ай бұрын

    @@jordanhasnolife5163 hey Jordan thanks for your prompt reply.

  • @huazhou2
    @huazhou25 ай бұрын

    @9:54, wouldn’t add element into min heap also change the index of array? i.e. the value in the hashmap?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    5 ай бұрын

    Yes good point, you can just build the heap first and then add in the hash-map.

  • @huazhou2

    @huazhou2

    5 ай бұрын

    Thanks@@jordanhasnolife5163! but the idea of using hashmap is to reduce time complexity for deleting/adding element from minheap, each element deletion or addition to the minheap will change like half branch's elements' indices (the worst case), and the deleting element from minheap is always o(logn) even if using a hashmap as a byside data structure (in this case, we also need to update hashmap whenever there's entry or exit of car, which increases time complexity), what do you think a way to reduce complexity for manipulating minheap in this case?

  • @Rakeshkumar-po2yg
    @Rakeshkumar-po2yg10 ай бұрын

    Hey @jordanhasnolife5163 I had a interview where I need to design a way where two screen are connected to each other (like a video wall Screens) and when we press "ON" button on remote controller both the screens will be turned on and when we press "OFF" button both will be turned of. Can we do with the help of sockets or if you can suggest a way to do so? Please help me.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    10 ай бұрын

    Is this a LLD or systems design question? If the latter than sure websockets work

  • @amen652
    @amen6524 ай бұрын

    Yo Jordan, I have a OOP type technical interview coming up. Been watching through your videos. Do you have any resources you could point me to that helped you with breaking down these problems, etc? (I like men)

  • @jordanhasnolife5163

    @jordanhasnolife5163

    4 ай бұрын

    Thanks for specifying that you like men at the end there, that helps. No specific resources, I think you should just try to search for the types of problems that get asked in these interviews, come up with your own solution, and then if you're struggling look up solutions online. Then from there iterate and look to apply what you learned!

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

    ig you put EXIT_NUMBER as a parameter in the method signature instead of the entrance_number

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Жыл бұрын

    Yup nice catch

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

    i come here only for the descriptions

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Жыл бұрын

    I come only for the men

  • @zuowang5185
    @zuowang5185Ай бұрын

    Typical parking lot doesn’t assign spot

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Ай бұрын

    Correct but then this problem wouldn't be worth doing. You'd just enter lol