The high-level design of Uber: interviewready.io/learn/system-design-course/design-a-cab-aggregator-app-like-uber/requirements-of-a-cab-aggregator I should have the high level design of Google Maps out this week. Wish me luck! EDIT: Google Maps: interviewready.io/learn/system-design-course/design-a-location-based-service-like-google-maps/requirements-of-a-map-application
It's really overwhelming for me but the passion you have it towards making us understand the thinking behind designing a schema !! inspires me Gaurav. More power to you man.
Clearly, you are very passionate about Computer Science and love spreading the knowledge. How do you manage exploring so much around? You must be a very productive person to delve into stuff. It gets overwhelming for me thinking if I’ll ever be this knowledgeable. Thanks for all the inspiration!
I frequently feel the same (about my productivity and the overwhelming sense that I am slow). But every now and then, I look back and feel good again 😁
I just don't know , how the heck a person can be this talented , you are intelligent , you are humorous(coming from interview with miss Rainy Jain).I could never even think of exploring so much and i will fight with the one if he says you aren't passionate enough . I know no one will say.YOUR parents must be so proud of you...oh gosh i will stop now
Working in the maps industry I'm really happy to see this come up on my feed. Looking forward to watching. Thanks for all your content. It's very accessible.
I would say “Star of the show” is always u , I’m mersmerised with your knowledge in each subject with which u build solutions.. cheers bud .. u r going to give a tough fight to even PhD guys in Berkeley
I think I know why I was recommended this, but I wasn't really in the mood - if attention span isn't already a metric, here you go youtube, enhance your algorithm - any way, this was incredibly insightful. I like your thought process. It's very logical and understandable. You're brilliant and I appreciate your insight. Thank you.
Bro, I bow down to you. To break down such a big concept into smaller parts and then not only explain the solution but how we reached the particular design. Can find a lot of videos on how something is implemented but this video tells why it is implemented the way it is. Job very well done.
I do have an onsite tomorrow and I found your channel late, you have so much talent explaining complex topics. It's good you are sharing that talent with the community.
Wow the fractal connection was totally unexpected. When you told dimensionality reduction, my mind immediately went to Principal Component Analysis but couldn't figure out how. Fractals was elegant👍
Hi just commenting on channels which helped me in one way or the other, land a great job offer from a huge firm! Thanks! I shared the channel with other people too!
Your video has come at such a great time. I'm getting started with building a rental car app and I've had a few issues while using maps in the app. This is going to help and I'm waiting for your next video on this topic. Thanks 😊
14:53 Why can’t we have 1 in fourth quadrant? Can you please elaborate the reason? And also explain why in certain permutation which number cannot be in which quadrant and why. thanks.
We are taking permutations which form unique shapes. Hence we must exclude rotations of the same shape. At 14:53, a 1 in the third quadrant will give us a rotation of the first shape (Z).
Bro, today you have gained my utter respect for your knowledge and your passion to pursue more knowledge. This video is mind-blowing, So much profound mathematical concepts linking with hardcore real-life applications.
@Gaurav Sen : This is very unlike your other videos. Even the 1st 10 minutes is greek and latin perhaps a much longer video is needed for this topic. Neverthless a very interesting topic.
I just failed a system design interview at a Senior level. Then I had a conversation with my friend and they told me: Have you ever heard of Gaurav Sen ? Me like: Who the ** is this ? Do I care ? Then I went on TH-cam and watched Gaurav Sen videos. After 2 videos, I told to myself: Damn, I deserve to fail that interview. My fault was that I did not know about Gaurav Sen before :(
18:00 Hi Gaurav - I'm curious how we have the established configuration of the rotation of Hilbert curves within each quadrant? Also - thanks for reviewing that continuity of lines -> infinite partitioning - I forgot this cool property of continuity from epsilon-delta definitions - and showing the intuition of quad trees lending to range queries via the line segment.
How will Quadtree solve the railway crossing issue? Two points are actually closer (but due to railway crossing, the delivery executive has to travel more) and to my understanding, these will be modelled closer to each other in Quadtree representation as well? 1:15
This is a hard concept. You've done some real in depth research and mixed the explanation with your wisdom. Is it possible that it could be asked to 2 years of Experience people? ( I know anything can be asked... ) What I mean is... How probable is it? Thanks!
I don't think this level of location based database knowledge is expected in any interview. The intent of the video was to provide the intuition necessary to understand the algorithms behind these databases :D
kinda cool the 2 projection works incredibly well on most road systems since they are in effect a 2-D lattice so you are fine with 90 degree turns at some accuracy threshold.
This video series explains a more suitable algorithm (A* search) for Google Maps: interviewready.io/learn/system-design-course/design-a-location-based-service-like-google-maps/requirements-of-a-map-application
Have you considered using Radix/Patricia-Trie for proximity. Like Quad-Tree you just explained, it converts lat-lon into 1D by using an open-source library called Geohash.. After converting a lat-lon into a prefix string, we apply the trie. Proximity just becomes natural. I spent some time trying to run algorithm like finding if a point is in Geofence or not. Had some error but had encouraging result.
14:00 felt like i was watching interstellar :) ... this video was a bit tough for me ..however i will watch the entire videos ...i will see different videos on this topic to understand it properly.
Awesome... Trying to get this kind of solution for the proximity use case from loong time.. Happy to see this explanation.. Pls make the other video also here, not in your course🤓
Video Summary: The video discusses the design of location-based databases for food delivery algorithms, highlighting the challenges of measuring distance and achieving scalability. It explores the use of uniform assignment and quad trees/R-trees for proximity-based queries, as well as the concept of squeezing a 1-D line into a 2-D plane using the Hilbert curve. The Hilbert curve allows for efficient range queries and proximity calculations in location-based databases. - 00:11 Location-based databases require uniformity and scalability in representing locations and measuring distances, with the common use cases being proximity and finding users within a certain distance. - 03:12 The video explains the challenges of representing and storing location data accurately in a database. - 06:26 The speaker explains how to use a 2-D binary search algorithm to determine the quadrant of a point based on its coordinates. - 09:37 The limitations of using quad trees or R-trees in location-based databases and the idea of converting a 2-D plane into a 1-D line. - 12:46 The speaker explains the concept of squeezing a 1-D line into a 2-D plane to preserve proximity information. - 15:59 The Hilbert curve is a recursive process that breaks a line segment into smaller parts, allowing for scalable granularity and infinite depth. - 19:14 The Hilbert curve is an infinite line that can be used to find points in close proximity at different levels.
Does the concept of proximity relates with a special form of non-Euclidean geometry called Taxicab Geometry developed by Hermann Minkowski ? As the points of locality are identified up with Hilbert space filling curve, the path seems identifiable with this Taxicab Geometry approach. Correct me, if I am going wrong with this.
Suppose we are using the Hilbert curve method on a 4 quadrant (A,B,C,D), when we are trying to get proximity of two points in A(top-left) & D(bottom-left). The proximity result would be "faaar away" in spite of being in adjacent quadrants. How do we overcome this problem?
It is very moralising for me to see youtubers like yourself who make informative videos, and helping the community to push boundaries of the tech unlike those shitty youtubers who make roast/dank/game stream videos..
So these Hilbert curve, kd-trees and quadtrees are used for Euclidean distance calculation. Whereas in Real-road scenarios the road is limited by the network distance and their directions. In that case, euclidean distance is not the best choice because Euclidean distance will be lesser than the network distance. So, how could we efficiently index the road network is the question. I have read several papers on "spatial queries such as k-Nearest neighbors query processing in (STATIC road network and DYNAMIC road network) and most of the dynamic road network discards the idea of indexing for efficiency. Could you please make a video on these things as well?
Great presentation, looking forward to seeing more. For anyone who wants more details on the theory, this is great: arxiv.org/pdf/1710.06384.pdf (The first ~20 pages are actually quite readable without getting proof heavy). They find neighbor cells exactly by recursively walking up and down the (implicit) quad tree formed by the space filling curve. Thus "... the runtime of the algorithm depends on how far one has to walk up and down the tree to find the neighbor. This concept is later introduced as the neighbor-depth of 𝑣. ... The neighbor-depth allows to characterize the runtime of the algorithm. In Theorem 4.1, we will show that the runtime of the algorithm is in 𝒪 (neighbor-depth) (assuming constant-time arithmetic operations). Using a standard geometric series argument, we will then show that the average neighbor-depth at level 𝑙 is 𝒪 (1) for all “normal” SFCs." (page 14)
I’m wondering, does this mean that problem of edge cases have no resolution and can be ignored? So users from regions 29 and 18 never won’t meet because they have distance of 11 in this representation which will exceeds the threshold?
Every time I watch your videos I always learn something new and unique, appreciate your efforts. I have a doubt though, I am trying to solve the same range problem for my location-based application using coordinates with the haversine formula in my SQL query, coordinates are stored as 'char'. Please clarify if there's something wrong with my approach.
Handsdown !!!!! one of the best videos in your list for sure. Definitely suggest this for GIS folks,....Would love to see your explanation for other data structures like R Tree Index, Grid Index etc.
While the design and explanation of it's implementation was interesting, what still remain unsolved is, with your example that you cited at the beginning of the video, how will latitude and longitude approach along with the 1 D mapping resolve the issue of bridge crossing to be considered while suggesting shortest but correct route
The high-level design of Uber:
interviewready.io/learn/system-design-course/design-a-cab-aggregator-app-like-uber/requirements-of-a-cab-aggregator
I should have the high level design of Google Maps out this week. Wish me luck!
EDIT:
Google Maps: interviewready.io/learn/system-design-course/design-a-location-based-service-like-google-maps/requirements-of-a-map-application
Is seems similar to geohash, are they both same or different approach?
It's really overwhelming for me but the passion you have it towards making us understand the thinking behind designing a schema !! inspires me Gaurav. More power to you man.
Clearly, you are very passionate about Computer Science and love spreading the knowledge. How do you manage exploring so much around? You must be a very productive person to delve into stuff. It gets overwhelming for me thinking if I’ll ever be this knowledgeable. Thanks for all the inspiration!
I frequently feel the same (about my productivity and the overwhelming sense that I am slow).
But every now and then, I look back and feel good again 😁
And the best part about Gaurav is .. .he teaches not for views but for a more higher purpose B)
I just don't know , how the heck a person can be this talented , you are intelligent , you are humorous(coming from interview with miss Rainy Jain).I could never even think of exploring so much and i will fight with the one if he says you aren't passionate enough . I know no one will say.YOUR parents must be so proud of you...oh gosh i will stop now
😁
Working in the maps industry I'm really happy to see this come up on my feed. Looking forward to watching. Thanks for all your content. It's very accessible.
😁
I would say “Star of the show” is always u , I’m mersmerised with your knowledge in each subject with which u build solutions.. cheers bud .. u r going to give a tough fight to even PhD guys in Berkeley
Thank you 😁
I think I know why I was recommended this, but I wasn't really in the mood - if attention span isn't already a metric, here you go youtube, enhance your algorithm - any way, this was incredibly insightful. I like your thought process. It's very logical and understandable. You're brilliant and I appreciate your insight. Thank you.
Bro, I bow down to you. To break down such a big concept into smaller parts and then not only explain the solution but how we reached the particular design. Can find a lot of videos on how something is implemented but this video tells why it is implemented the way it is. Job very well done.
Literally 2 days ago I was reading about Google Maps algorithm and it's working, and you have made my wish come true by uploading this
I loved the way you explained 2d to linear. It can not be simpler than this.
I do have an onsite tomorrow and I found your channel late, you have so much talent explaining complex topics. It's good you are sharing that talent with the community.
"taxiii sharing services" was wicked
that pause! I really laughed out loud xD
This guy has huge knowledge and logic I wish I could have 1% of him...everything went out of my mind I could not understand anything
This is an ideal use of TH-cam.. . Well done GKCS
I've never seen such a perfect video explaining hilbert curve!!
You blew my mind up so hard it's spilt all over my computer!! This is amazing!
Thanks a lot, I'm just 15. I learnt new thing. Bro you can yourself start a bigger company than Google.
This guy has more knowledge than all of my Engg clg's faculty combined.
😂😂😂😂😂
It is so easy to criticize your teachers but have you ever thought why are you enrolled in such a college?
@@swapk99 just one word "Majburi"
@@jibrankhan499 bhai shi kha aapka to naam bhi jabran hai :P
@@jibrankhan499 Apni Galti ki wajha majburi ko mat do!
Loved the way you explained the hilbert curve and its application to the problem at hand.
This video deserves far more views/attention, excellent efforts
This is basically masterclass in system design...inspiring
Wow the fractal connection was totally unexpected. When you told dimensionality reduction, my mind immediately went to Principal Component Analysis but couldn't figure out how. Fractals was elegant👍
Interesting, I think PCA was a good guess!
I thought of PCA too but I was wondering how he would apply it. Good thing he went to Hilbert Curves and I learnt something new today
Wow this is exactly what we were discussing in our project today
Hi just commenting on channels which helped me in one way or the other, land a great job offer from a huge firm! Thanks! I shared the channel with other people too!
Beautiful explanation and the best part is the way you explained the application of hilbert curve. Kudos!
Thank you 😁
Great explanation of hilbert curve! thanks!
Intro is solid, content is as usual as dope
Your video has come at such a great time. I'm getting started with building a rental car app and I've had a few issues while using maps in the app. This is going to help and I'm waiting for your next video on this topic. Thanks 😊
The most interesting video I have ever seen!!!
Thanks!!
You just opened a whole new world to explore! Very interesting and exciting to expand it's applications.
your editing skills are too good like your teaching skills.
One of the best content I have seen, in such a short time !!! Thanks Man !
Thank you!
Your passion for tech shows in your videos.
I am not even a tech guy and i watched the whole video.
😁
When the Master teaches, us Students listen. thank you for the great video, most of it made sense towards the end,
Exactly what I was stuck on today... You made it simpler gaurav... Thanks loads.
Wow! I like your style of teaching. This was very well explained. Keep it up!
Wow! The concept is really interesting. Thanks, man!
Like before watch. That much, I trust your teaching skills.
Appreciate that 😁
14:53 Why can’t we have 1 in fourth quadrant? Can you please elaborate the reason?
And also explain why in certain permutation which number cannot be in which quadrant and why.
thanks.
We are taking permutations which form unique shapes. Hence we must exclude rotations of the same shape.
At 14:53, a 1 in the third quadrant will give us a rotation of the first shape (Z).
Bro, today you have gained my utter respect for your knowledge and your passion to pursue more knowledge. This video is mind-blowing, So much profound mathematical concepts linking with hardcore real-life applications.
Respect for your knowledge Gaurav.
It's amazing, Literary encounters some new concepts and thoughts, we never heard before.
Thank you so much, Sir🙂
Thanks 😁
Brilliant video, explained really well. Thanks Gaurav
@Gaurav Sen : This is very unlike your other videos. Even the 1st 10 minutes is greek and latin perhaps a much longer video is needed for this topic. Neverthless a very interesting topic.
Thanks for the feedback 🙂👍
I just failed a system design interview at a Senior level. Then I had a conversation with my friend and they told me: Have you ever heard of Gaurav Sen ?
Me like: Who the ** is this ? Do I care ?
Then I went on TH-cam and watched Gaurav Sen videos. After 2 videos, I told to myself: Damn, I deserve to fail that interview. My fault was that I did not know about Gaurav Sen before :(
Hahahaha!
Thank you for the kind words, all the best for your next interview :D
Gr8 Content Gaurav ! Keep learning and sharing !
This dude is brilliant.
Enjoyed the video very much, Thanks gkcs Bhaiya!!
I am really looking forward to the food delivery app system design!
S_id, Hilbert curves I guess is the short answer? The fractal part was very interesting
explained well, such a complicated topic.
Got an opportunity to learn something new! Thanks so much!
wow Gaurav, you are amazing :), happy enough to watch this, as the video was just released, very well done
Me: currently working on geo spatial visual representations
Algorithm: where did that bring you? back to me.
I was curious about how these apps work before watching this. Now I'm even more curious and feel i don't know anything . this is just great work!
They have some super cool stuff under the hood 😁
@@gkcs yep i hope to work on that under the hood stuff someday :P
You are awesome at explaining, thank you for all your effort!
most underrated channel bro please do video on competitive program tutorial questions..love from nepal
18:00 Hi Gaurav - I'm curious how we have the established configuration of the rotation of Hilbert curves within each quadrant?
Also - thanks for reviewing that continuity of lines -> infinite partitioning - I forgot this cool property of continuity from epsilon-delta definitions - and showing the intuition of quad trees lending to range queries via the line segment.
Amazingly explained
How will Quadtree solve the railway crossing issue?
Two points are actually closer (but due to railway crossing, the delivery executive has to travel more) and to my understanding, these will be modelled closer to each other in Quadtree representation as well?
1:15
Love your videos Gaurav thanks a lot and keep them coming.
Very Nice explanation.
This is a hard concept.
You've done some real in depth research and mixed the explanation with your wisdom.
Is it possible that it could be asked to 2 years of Experience people?
( I know anything can be asked... ) What I mean is... How probable is it?
Thanks!
I don't think this level of location based database knowledge is expected in any interview. The intent of the video was to provide the intuition necessary to understand the algorithms behind these databases :D
You really know how to explain. Keep it up 👍
this is the channel i was looking for...
wow, this is alot of information in one video :D, ive watched it twice now, and im still confused. Ill get the hang of it though, thanks Guarav!!!
@4:47, can someone explain how this example works? mapping 5 in range 4 to 7?
anyone? This part is going over my head
kinda cool the 2 projection works incredibly well on most road systems since they are in effect a 2-D lattice so you are fine with 90 degree turns at some accuracy threshold.
This video series explains a more suitable algorithm (A* search) for Google Maps:
interviewready.io/learn/system-design-course/design-a-location-based-service-like-google-maps/requirements-of-a-map-application
Thanks for this one. Much anticipated one!
More to come! 😁
Gaurav man.. i always wanted to know about these Spatial Database topics concepts. Thanks alot 😊
This guys should be teaching in havard or iiTs !! Great explanation and design idea.
Thanks!
So cool edits in the video. Perfect.
Wow Gaurav, you are amazing :), I learnt this concept from educative but your explanation is too good.
Thanks 😁
3:06 distance formula is wrong its sqrt (pow(x1-x2,2)+pow(y1-y2,2))
Have you considered using Radix/Patricia-Trie for proximity. Like Quad-Tree you just explained, it converts lat-lon into 1D by using an open-source library called Geohash.. After converting a lat-lon into a prefix string, we apply the trie. Proximity just becomes natural. I spent some time trying to run algorithm like finding if a point is in Geofence or not. Had some error but had encouraging result.
Awesome explanation. I wonder why not use Dijkstra's Algorithm for path finding here
14:00 felt like i was watching interstellar :) ... this video was a bit tough for me ..however i will watch the entire videos ...i will see different videos on this topic to understand it properly.
Love you brother keep growing
Awesome... Trying to get this kind of solution for the proximity use case from loong time.. Happy to see this explanation.. Pls make the other video also here, not in your course🤓
Love the new intro bro!
Video Summary:
The video discusses the design of location-based databases for food delivery algorithms, highlighting the challenges of measuring distance and achieving scalability. It explores the use of uniform assignment and quad trees/R-trees for proximity-based queries, as well as the concept of squeezing a 1-D line into a 2-D plane using the Hilbert curve. The Hilbert curve allows for efficient range queries and proximity calculations in location-based databases.
- 00:11 Location-based databases require uniformity and scalability in representing locations and measuring distances, with the common use cases being proximity and finding users within a certain distance.
- 03:12 The video explains the challenges of representing and storing location data accurately in a database.
- 06:26 The speaker explains how to use a 2-D binary search algorithm to determine the quadrant of a point based on its coordinates.
- 09:37 The limitations of using quad trees or R-trees in location-based databases and the idea of converting a 2-D plane into a 1-D line.
- 12:46 The speaker explains the concept of squeezing a 1-D line into a 2-D plane to preserve proximity information.
- 15:59 The Hilbert curve is a recursive process that breaks a line segment into smaller parts, allowing for scalable granularity and infinite depth.
- 19:14 The Hilbert curve is an infinite line that can be used to find points in close proximity at different levels.
10:07 That T Shirt change though 🤣
Wonderful explanation! :)
Does the concept of proximity relates with a special form of non-Euclidean geometry called Taxicab Geometry developed by Hermann Minkowski ? As the points of locality are identified up with Hilbert space filling curve, the path seems identifiable with this Taxicab Geometry approach. Correct me, if I am going wrong with this.
the coolest engineer
Great Effort! Appreciate it!
Waouh thanks for your work, this video is what I was looking for
truly beautiful
Suppose we are using the Hilbert curve method on a 4 quadrant (A,B,C,D), when we are trying to get proximity of two points in A(top-left) & D(bottom-left). The proximity result would be "faaar away" in spite of being in adjacent quadrants. How do we overcome this problem?
Please make a dedicated video on Z-order curve
It is very moralising for me to see youtubers like yourself who make informative videos, and helping the community to push boundaries of the tech unlike those shitty youtubers who make roast/dank/game stream videos..
Mein poora dekhega video..
Bhale hi 1% ghusse dimag mein.
😌
Haha... Bro, mujhe tera 1% bhi zyada lag rha hai.. :p
So these Hilbert curve, kd-trees and quadtrees are used for Euclidean distance calculation. Whereas in Real-road scenarios the road is limited by the network distance and their directions. In that case, euclidean distance is not the best choice because Euclidean distance will be lesser than the network distance. So, how could we efficiently index the road network is the question. I have read several papers on "spatial queries such as k-Nearest neighbors query processing in (STATIC road network and DYNAMIC road network) and most of the dynamic road network discards the idea of indexing for efficiency. Could you please make a video on these things as well?
Good topics to get to 👍😁
Amazing video! Thanks Gaurav...BTW from where have you taken the map of India (5:01)? Its showing areas near Aksai Chin Lake in China :D
I hadn't noticed that! I picked it from Wikimedia commons I think.
Here is an article on Aksai Chin: en.wikipedia.org/wiki/Aksai_Chin
Great presentation, looking forward to seeing more.
For anyone who wants more details on the theory, this is great: arxiv.org/pdf/1710.06384.pdf (The first ~20 pages are actually quite readable without getting proof heavy).
They find neighbor cells exactly by recursively walking up and down the (implicit) quad tree formed by the space filling curve. Thus "... the runtime of the algorithm depends on how far one has to walk up and down the tree to find the neighbor. This concept is later introduced as the neighbor-depth of 𝑣. ... The neighbor-depth allows to characterize the runtime of the algorithm. In Theorem 4.1, we will show that the runtime of the algorithm is in 𝒪 (neighbor-depth) (assuming constant-time arithmetic operations). Using a standard geometric series argument, we will then show that the average neighbor-depth at level 𝑙 is 𝒪 (1) for all “normal” SFCs." (page 14)
Good stuff!
I’m wondering, does this mean that problem of edge cases have no resolution and can be ignored? So users from regions 29 and 18 never won’t meet because they have distance of 11 in this representation which will exceeds the threshold?
Can you make a video on how the backend for real-time online multiplayer games like CSGO, pubg work?
+1
Every time I watch your videos I always learn something new and unique, appreciate your efforts. I have a doubt though, I am trying to solve the same range problem for my location-based application using coordinates with the haversine formula in my SQL query, coordinates are stored as 'char'. Please clarify if there's something wrong with my approach.
Handsdown !!!!! one of the best videos in your list for sure. Definitely suggest this for GIS folks,....Would love to see your explanation for other data structures like R Tree Index, Grid Index etc.
Thank you 😁
While the design and explanation of it's implementation was interesting, what still remain unsolved is, with your example that you cited at the beginning of the video, how will latitude and longitude approach along with the 1 D mapping resolve the issue of bridge crossing to be considered while suggesting shortest but correct route