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

  Рет қаралды 4,339

Jordan has no life

Jordan has no life

Жыл бұрын

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

Пікірлер: 24
@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!
@supritdk2956
@supritdk2956 15 күн бұрын
As already pointed by a couple other comments, when you add/ remove elements from priority queue, you would heapify which changes the index for the spot in underlying array. This would mean your hashmap goes out of sync not only for the element that is being inserted/deleted but in worst case for all the elements in the map. You would then have to construct the entire map again which I dont think is very good and negates the value provided by the priority queue. At this point you may as well do a linear search. Am I missing something here?
@jordanhasnolife5163
@jordanhasnolife5163 15 күн бұрын
Yep in retrospect something like a doubly linked list with hash map would have been better here.
@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
@Rakeshkumar-po2yg
@Rakeshkumar-po2yg 11 ай бұрын
@jordan Can you please elaborate more on parkingSpotHashMap and pQueues ? How these are defined .
@jordanhasnolife5163
@jordanhasnolife5163 11 ай бұрын
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 11 ай бұрын
@@jordanhasnolife5163 hey Jordan thanks for your prompt reply.
@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
@amen652
@amen652 5 ай бұрын
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 5 ай бұрын
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!
@Rakeshkumar-po2yg
@Rakeshkumar-po2yg 11 ай бұрын
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 11 ай бұрын
Is this a LLD or systems design question? If the latter than sure websockets work
@huazhou2
@huazhou2 6 ай бұрын
@9:54, wouldn’t add element into min heap also change the index of array? i.e. the value in the hashmap?
@jordanhasnolife5163
@jordanhasnolife5163 6 ай бұрын
Yes good point, you can just build the heap first and then add in the hash-map.
@huazhou2
@huazhou2 6 ай бұрын
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?
@priyanshubajpai6925
@priyanshubajpai6925 Жыл бұрын
ig you put EXIT_NUMBER as a parameter in the method signature instead of the entrance_number
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Yup nice catch
@zuowang5185
@zuowang5185 2 ай бұрын
Typical parking lot doesn’t assign spot
@jordanhasnolife5163
@jordanhasnolife5163 2 ай бұрын
Correct but then this problem wouldn't be worth doing. You'd just enter lol
@kunparekh1886
@kunparekh1886 Жыл бұрын
i come here only for the descriptions
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
I come only for the men
Design A Limit Order Book | Google SWE Teaches Low Level Design Episode 5
22:18
Amazon System Design Interview: Design Parking Garage
29:59
Exponent
Рет қаралды 1,4 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
Mock Low Level System Design Interview with Qualcomm Sr. Engineer - Design Meeting Scheduler
37:23
Design Google Docs System Design Interview Tips
14:13
Null Bytes
Рет қаралды 250
10 LLD Interview Tips you should follow!!
13:25
Keerti Purswani
Рет қаралды 30 М.
HOW TO PARK A CAR IN A PARKING SPACE FOR BEGINNERS
7:04
Driving TV
Рет қаралды 1,4 МЛН
Google Systems Design Interview With An Ex-Googler
59:59
Clément Mihailescu
Рет қаралды 761 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,9 МЛН
Самые крутые школьные гаджеты
0:49
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 8 МЛН
iPhone 15 Pro Max vs IPhone Xs Max  troll face speed test
0:33
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,3 МЛН