Тёмный
code Tree
code Tree
code Tree
Подписаться
Getting into a top technology company is tough but not impossible, this channel is aimed at helping people prepare for technical interviews at big tech like Facebook, google, amazon etc.

If the channel videos did helped you to enhance your knowledge or clearing an interview, please do like and subscribe !

Cheers!
Комментарии
@sravanchaitanya7372
@sravanchaitanya7372 4 месяца назад
very well explained thankyou for your time.
@misterdonaldduck
@misterdonaldduck 5 месяцев назад
What does the orange diamond mean?
@chessmaster856
@chessmaster856 6 месяцев назад
You can't know everything. You need to ask requirements and model only those
@anonymous.........
@anonymous......... 6 месяцев назад
vey nice explanation bro, thanks
@arpanbanerjee6224
@arpanbanerjee6224 7 месяцев назад
Great explanation, with pros and cons of each design decision. Covered almost all the aspects of it. This is how everyone should explain system design concepts. Thank you! please keep making for videoes.
@abhishekmudaliyar5361
@abhishekmudaliyar5361 8 месяцев назад
Bro code please
@anshulchauhan6738
@anshulchauhan6738 10 месяцев назад
Looks like the copy of Educative design
@anthonya880
@anthonya880 12 дней назад
Is d course on educative good ?
@sankalpjain8192
@sankalpjain8192 Год назад
Hey i have a question like why there is an association between parking spots and vehicle, you said that association means class A calls class B and this means that class parking spot is calling class vehicle ..can you explain why this is happening and why we have made child classes for parking spots like if this is required than vehicle class should not be required and if vehicles is required than this should not be, please explain in detail.
@dezediok2451
@dezediok2451 Год назад
Is there a particular design pattern that you implemented for the UML class diagram? If so what is that pattern called?
@arunavasaha7051
@arunavasaha7051 Год назад
In the last optimization, when the elevator was moving up and dropped the passenger of floor 0 at floor 2, and picked the passenger at floor 2 who requested a down , why the elevator changed the direction and dropped them first. Shouldnt the lift continue togo up and attend the request of the passengers going up first?
@AnkitYadav-up4
@AnkitYadav-up4 Месяц назад
that is the drawback u would say for this algorithm thats why we have to take care of one direction only by marking any of the direction as true either up or down once the lifts starts to move maintain 3 varibles as bool and mark them as true until it reaches the last pos of requested then mark as false and changes the directin of the lift so that the requested of other can also be taken care of
@sakshamjain1005
@sakshamjain1005 Год назад
MinHeap update operation is quite costly since its getting updated at every move of lift in either direction O(NLog(N)) to be precise
@TheSubsonicOne
@TheSubsonicOne 11 месяцев назад
It's an ELEVATOR. It only has so many floors. Unless it's being implemented by actual snails, or a 1HZ processor, I think it will be fine.
@mohitrathore8808
@mohitrathore8808 Год назад
Please add timestamps :), btw nice video
@learnwithme7750
@learnwithme7750 Год назад
Good explanation but a small doubt i.e whenever a position of car changes everytime we have to pop all enteries of both minhips and update it again, so will that be efficient?
@codeTreeMS
@codeTreeMS Год назад
yes that might not be efficient but O(nlogn) is not asymptotically tight, search for tighter bound for hepify. It might not be awesome algorithm but can do the work rest is on our innovations.
@learnwithme7750
@learnwithme7750 Год назад
@@codeTreeMS ok thanks!
@aseem30
@aseem30 Год назад
Any interviewer is going to ask why you picked up min heap of all the data structures.
@codeTreeMS
@codeTreeMS Год назад
Thats a resonable question and had a resonable answer, time complexity. in O(1) you can get the closest person to the elevator.
@krishnaneeldey8722
@krishnaneeldey8722 Год назад
Why f(0)=1?
@codeTreeMS
@codeTreeMS Год назад
You can understand it as another way to include the number 0, and if you have only 1 bit to fill in you can make only 1 number that is 0.
@MrKB_SSJ2
@MrKB_SSJ2 Год назад
lol
@sokachinnarao7694
@sokachinnarao7694 Год назад
Sir, one small doubt, how many elevators are required in buildings
@codeTreeMS
@codeTreeMS Год назад
It depends on how many people work/stay in the building, like an office with a high number of floors with 1000 people working will require more elevators than a smaller building with 300 people, its something easy and you can discuss with your interviewer to decide on this requirement.
@AyushKumar-yn3xb
@AyushKumar-yn3xb 2 года назад
Runtime updation of minHeap, as the elevator car crosses a floor, is equivalent to creating a new minHeap everytime? I am not sure there is any straight forward way to update the values in a minHeap/maxHeap.
@karthikairam
@karthikairam Год назад
There is a “decrease key” operation in the Heap which does changing of node’s value, in o(log n) runtime when it is combined with HashMap to maintain the position of node in array (Heap uses behind the scene). You may explore it further.
@ilikememes9052
@ilikememes9052 2 года назад
Bro what an epic explanation. Thanks 🙏 for this video.
@mojolu1126
@mojolu1126 2 года назад
isn't there a relationship from door to car? 18:14
@jasiuskwarczek
@jasiuskwarczek 2 года назад
There might be, also you can make Door class as a base class and then inherit from it as Elevator Door, Emergency Door, Service Door etc. and then create a relationship from Door to Car class imo
@mojolu1126
@mojolu1126 2 года назад
16:09 you spelled elevator wrong
@TheSudh123456
@TheSudh123456 2 года назад
awesome explanation. Insightful.
@shashankmishra484
@shashankmishra484 2 года назад
Hey thanks for this video Sorry this is out of context, but what chair are you using ? I have seen this one at different places but not able to find it
@codeTreeMS
@codeTreeMS 2 года назад
haha, no worries.. I think this one is pretty close www.ikea.com/se/sv/p/markus-kontorsstol-vissle-moerkgra-70261150/ , you can get the same in any country.
@USATECH-um3of
@USATECH-um3of 2 года назад
2X10 power 10= 2 X 10 power 4 TB not 2X 10 power 3 TB
@seemapatel1333
@seemapatel1333 2 года назад
Very well explained . Thank you so much !
@HimalayaGarg
@HimalayaGarg 2 года назад
Should change the distance in heap when lift is moving
@Ash-fo4qs
@Ash-fo4qs 2 года назад
make more videos of leetcode problems.
@codeTreeMS
@codeTreeMS 2 года назад
do you have some special questions ? share the problems you find more interesting/difficult, and i would prioritize them.
@ankursingh4115
@ankursingh4115 2 года назад
When doing update min frequency, how do you know next min frequency is 1 more then minimum, can't that also be empty
@codeTreeMS
@codeTreeMS 2 года назад
when you delete the keys from freq_map, you would delete from the linked list having min_frequency. Now in a situation when the list corresponding to this min_freq has been deleted, then the min_freq will be 1 + the prev min_freq. Suppose again some one inserts a new element then new min_freq becomes 0.
@anilchaudhry804
@anilchaudhry804 2 года назад
code in java?
@PriyaKumari-rl7zw
@PriyaKumari-rl7zw 2 года назад
Very well explained.
@nitansshujain811
@nitansshujain811 2 года назад
Sir, you have to you use priority_queue instead to simple queue to print the result in lexicographical order.
@codeTreeMS
@codeTreeMS 2 года назад
but why you want to print them, the algorithm takes care of getting a possible answer that is lexicographically sorted.
@vaibhavghadge4057
@vaibhavghadge4057 2 года назад
Use white background
@PriyaKumari-rl7zw
@PriyaKumari-rl7zw 2 года назад
Hard to find such stuff on the internet. Thank you!
@shobhittrivedi435
@shobhittrivedi435 2 года назад
The number of min heaps would be same as number of entrances. However, the nodes (spots) considered for min heaps should be disjointed - no 2 min heap to have same spot else there would be an overhead in maintaining. However doing so has another observation, if one entrance exhausts all the spots, it would then need to refer the min heap of the closest entrance. Thoughts?
@neerajagarwal3176
@neerajagarwal3176 2 года назад
great work. Please upload more videos like this.
@billfang2666
@billfang2666 2 года назад
I like the video because it is succinct and explained well.
@nikhilraj9900
@nikhilraj9900 2 года назад
Can you please make more videos on toposort and dsu. Thanks in advance
@codeTreeMS
@codeTreeMS 2 года назад
will try to make it asap ! Thanks for the support.
@Paradise-kv7fn
@Paradise-kv7fn 2 года назад
Snake and ladder can inherit from a common base class which will contain their common attributes.
@nikhilraj9900
@nikhilraj9900 2 года назад
Why do you put empty array
@codeTreeMS
@codeTreeMS 2 года назад
we want to find all the connections to every character in the given set of words, it is possible that a character can have multiple connections. You build an adjecency list using all characters thats whay an unordered map with <char, vector> , the empty list is just to initialize the vector.
@nikhilraj9900
@nikhilraj9900 2 года назад
@@codeTreeMS no bro I am asking this for graph[ch]={}. I am just confused 🤔
@codeTreeMS
@codeTreeMS 2 года назад
@@nikhilraj9900 beacuse you want to poulate the graph with every character in the word list, while populating its better to initialize it with {} array since we have declared the unordered map as {char, array}. Eveny if you write the code as graph[ch]; its fine.
@manus7342
@manus7342 2 года назад
Very well explained. Please make more OOD videos
@codeTreeMS
@codeTreeMS 2 года назад
Thanks ! Will get back to making more such vidoes soon.
@manus7342
@manus7342 2 года назад
@@codeTreeMS Thanks :)
@nandanapuameer4693
@nandanapuameer4693 2 года назад
which tool are you using to design this
@warnercooler4488
@warnercooler4488 3 года назад
Nice explanation of the algorithm. Thank you so much!
@jbbanerjee8534
@jbbanerjee8534 3 года назад
In the last part of the video , you have used 2 heaps . When you are not using the direction of the car to pickup up the passenger , what's the point in keeping 2 heaps ? You can simply use 1 heap and pickup the closest passenger irrespective of the direction he/she wants to move. This is a bit confusing .
@codeTreeMS
@codeTreeMS 3 года назад
Thanks for pointing out. Yes, if you are not having a constraint on direction then you can use just one min heap, I wanted to give a starting algorithm which anyone can extend and optimized further. e.g.Some elevator systems pick passengers only in the dircetion of travel then the 2 heaps would help.
@PeskyTheWabbit
@PeskyTheWabbit 2 года назад
@@codeTreeMS This was my first thought. Starting at floor 0, it goes up until no one else needs to go up, then it starts at the top and brings down everyone who needs to go down. then start with people going up, rinse, repeat
@prashanthbomma
@prashanthbomma 3 года назад
Thanks for making this video. It's really helpful. Please do make such videos on all popular LP questions.
@ameyjain3462
@ameyjain3462 3 года назад
Just create a button class, there may be tons of button with different functionalityies, i dont get why emergency is special and how it affects your design
@codeTreeMS
@codeTreeMS 3 года назад
Firstly thanks for the comment, it helps create the present and future videos better !!. if you see at 11:07, in the class diagram, there is a class for buttons and we extend from it to create inside and outside buttons. Do you mean somthing else
@vyczn
@vyczn 3 года назад
Thanks for your solution. Regarding the presentation, can't you just type stuff instead of handwriting, because latter looks super tedious for you and incomprehensible for viewers.
@codeTreeMS
@codeTreeMS 3 года назад
sorry for those scribbled text ! I was new to digital pens. But you are right , I would make sure the text are much cleaner/typed. Thanks a lot for the suggestion.
@ram9523
@ram9523 3 года назад
Nice . thank you
@ram9523
@ram9523 3 года назад
Nice
@sivr3352
@sivr3352 3 года назад
Wonderful