In this video we are solving a popular interview question with companies like Google, Amazon, and Microsoft: Find Median From Data Stream.
On the surface this question looks easy but in order to get past the initial simple, naive solutions, you need to be a little clever with heaps in order to solve this question. This is one where you likely won't get it the first on your own because of how crazy the solution is, but once you see it written out and it clicks for you, it will make complete sense.
Stay tuned to figure out how we are going to solve this problem. The code for this solution is actually less than 10 lines!
5 сен 2024