Google Maps System Design Interview Question

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • This is a solution for System Design Interview Question where you need to design a Map + Navigation application like Google Maps.
    This problem has been asked by a lot of companies like Google, Amazon, Flipkart, Walmart Labs to name a few.
    Prerequisites:
    How to select the right Database for a Large Scale System: • Database Design Tips |...
    Summary of this video: www.codekarle....
    Architecture diagram: github.com/cod...
    Author: / sandeep1904
    If you like this video, please help us grow by sharing this video with your friends on Facebook, connections on LinkedIn and anyone who can benefit from this.
    PS: This is not the real architecture of Google Maps or any other similar service. This is my take on how I would answer that problem.
    #codekarle #systemdesign #googlemaps #googlemapssystemdesign #system #design #interview #faang #maps

КОМЕНТАРІ • 151

  • @getsiva33
    @getsiva33 4 роки тому +114

    I reckon this will become the best system design channel in youtube. Keep up the good work !

    • @codeKarle
      @codeKarle  4 роки тому +2

      Thanks for the motivation! Do share it with your friends to help us get there 🙂

    • @baurks
      @baurks 4 роки тому +5

      I second this. This is by far the best system design video I watched on youtube.

    • @rohanagarwal5512
      @rohanagarwal5512 3 роки тому +1

      true

    • @satyajeetkumarjha1482
      @satyajeetkumarjha1482 3 роки тому

      Exactly.

    • @imkx13
      @imkx13 2 роки тому

      No doubt about that.

  • @ShahbazKhan275817
    @ShahbazKhan275817 2 роки тому +7

    you channel name should be DesignKarle instead 😛

  • @Kevin-jt4oz
    @Kevin-jt4oz 3 роки тому +35

    This is brilliant but Im kinda surprised you didnt mention quad trees. They are the standard way to solve problems like this.

    • @rjarora
      @rjarora 2 місяці тому +1

      I don't think quadtrees are used to handle Google Maps use case. They are supposed to return the nearest neighbours, which is a different use case. Although the idea to divide the globe into different segments can be borrowed from quad trees here.

  • @wenhoujx
    @wenhoujx 10 місяців тому +2

    very good content, but the audio is a torture.

  • @sanjana8358
    @sanjana8358 3 роки тому +16

    This was on its way to become the best sys design channel on UA-cam but why did you stop making videos? All other channels just have scattered information and no clarity of thought. Can you start making videos again and cover more systems asked in interviews? It will be of great help to budding software engineers!

  • @TheCodeThoughts
    @TheCodeThoughts 2 роки тому +1

    is it really true that Google Map has 1 billion users? we have 7 billion population and out of them so many kids, old people and huge population of the world might not use these apps.

  • @topgamerprosh75
    @topgamerprosh75 2 роки тому +8

    I banged the first AWS interview and Meta interview in one go. Thanks for the detailed explanation! Not sure if you are active anymore, but you deserve lot more followers than what you have.

    • @illyam689
      @illyam689 5 місяців тому

      how is it going now?

    • @pavankalyan6547
      @pavankalyan6547 Місяць тому

      What other system design resources do you recommend for the interview preparation?

  • @HusainDalal
    @HusainDalal 2 роки тому +9

    This is the level of details that helps in real interviews. Thanks!

  • @humeyratopcu3274
    @humeyratopcu3274 4 роки тому +41

    It was an awesome video. Thank you very much!
    Some friendly suggestions:
    1. Data models could be added (KV stores, data size, replication and sharding)
    2. Instead of specific technology names, generic names could be used. "Queue" instead of Kafka, "NoSQL database" instead of Cassandra
    3. Geospatial index could be mentioned

    • @codeKarle
      @codeKarle  4 роки тому +5

      Yeah, true, that could be done :)

    • @KidsGaming-yo8ve
      @KidsGaming-yo8ve 11 місяців тому

      @@codeKarle why Cassandra is chosen in this scenario. It is column based databases? why not document db kind of db is used?

  • @metallaser4409
    @metallaser4409 3 роки тому +6

    Thanks for the video. Could you comment a little bit on the schema of the Cassandra tables storing segments/distances between exit points of segments? Also, how come you didn't consider using a graph database such as Neo4j? (I don't know much about it at all, but I would think it is designed specifically for a usecase like this?)

  • @gunchoi
    @gunchoi 4 роки тому +4

    You are pretty smart! Thank you for your videos. I am learning it out of curiosity

    • @codeKarle
      @codeKarle  4 роки тому

      Thanks!! Happy that the videos are helping you

  • @prateekchs
    @prateekchs 3 роки тому +14

    While preparing for interviews for experienced level, one can agree that system design level is the deciding round many times. I also used to struggle in these rounds and hence searched hell lot of resources to understand the concept but nowhere found satisfying result. This is the only channel where I started seeing patterns in designs, role of different components, out of the box solutions and no-fancy/complex components/logic.
    Designs explained are so simple that after going through few designs, any one can start creating boxes and understand flows between them while approaching to a new problem.

    • @codeKarle
      @codeKarle  3 роки тому +6

      Thanks Prateek!
      The whole idea of this channel is to propose simple solutions to complex real world problems :)
      Do spread the word about the channel among your connections! It helps :)

  • @benli657
    @benli657 Рік тому +2

    🎯 Key Takeaways for quick navigation:
    00:02 🗺️ Navigation app design like Google Maps requires route, distance, and time info.
    00:57 🔌 System design should be pluggable for easy addition of features like traffic, weather, etc.
    02:22 🌐 The system needs to handle high availability, good accuracy, and reasonable speed.
    03:50 📈 Massive scale: Billions of user requests, millions of companies using the platform.
    04:18 🛣️ Building a navigation app is challenging due to vast road data and unpredictable attributes affecting ETA.
    22:14 🗺️ Mega-Segment approach: Dividing the map into Mega-Segments containing exit points, simplifying navigation across large areas.
    24:32 ⏲️ Weight calculation: Factors like distance, ETA, and average speed influence weights; traffic and weather are attributes, not weights.
    27:19 🚗 Traffic data: Utilizing real-time user data for traffic; data is normally distributed, allowing prediction within confidence intervals.
    30:05 🔄 Dynamic updates: Changing ETA due to traffic/weather; cascading updates through segments and Mega-Segments when weights change significantly.
    39:33 📊 System architecture: Overview of user location tracking, data processing, and updates to enhance map service.
    45:32 📍 Hotspot Identifier: Identifying areas with increased activity using location data, enabling better traffic prediction and navigation.
    46:32 🚗 Vehicle Identifier: Analyzing location pings to determine the type of vehicle (e.g., car, bus, two-wheeler) and enhance navigation insights.
    49:20 🗺️ Area Search Service: Converts location search into lat/long, aiding navigation and route calculation.
    50:44 🛤️ Map Service & Navigation Tracking: Handling user navigation, course correction, and analyzing user journeys to improve recommendations.
    57:22 ⏰ ETA Accuracy & Analytics: Monitoring accuracy of estimated travel times, analyzing route preferences, and inferring user profiles based on location data.
    Made with HARPA AI

  • @avikbagh8391
    @avikbagh8391 2 роки тому +1

    Quality content as always. But plz do something about your audio.

  • @pkr619
    @pkr619 3 роки тому +12

    I have watched quite a lot of system design videos from different sources, and this by far, exceeds most of them in technical depth and breadth. It's not too academic and neither too complex, well done! I am recommending this channel to my peers.

  • @Mustaq15
    @Mustaq15 2 місяці тому

    Can you plz...... teach system design from basics. Playlist

  • @vivekkushwaha2851
    @vivekkushwaha2851 4 місяці тому

    Sorry if this sounds basic, but I'm new to system design and still learning. Can you explain why you didn't save which user is linked to which WebSocket handler at 41:35 in the video? You mentioned polling for this info, but where does it come from exactly? Is it from the WebSocket handler itself?
    By the way, great video! 🙌 I really learned a lot from it and appreciate your work!

  • @ektabhalwara7531
    @ektabhalwara7531 4 роки тому +3

    This was an amazing explanation!!! I request you to please post a video about LinkedIn System Design as well. Good Work!!!

    • @codeKarle
      @codeKarle  4 роки тому +1

      Thanks!!
      That would be almost the same design as Facebook, since both have the same feature set like posts, likes, comments, share, etc. Only the Jobs thing is different, but if we can skip that, I would recommend to watch the Facebook System Design video here: ua-cam.com/video/9-hjBGxuiEs/v-deo.html

  • @i_DeepakV
    @i_DeepakV Місяць тому

    Great level of details are captured, Thanks for creating this video.
    It would be nice to have details on how we would store huge data set of map service, and how we would enable quick update on this dataset.

  • @TheKshitijagrawal
    @TheKshitijagrawal Рік тому

    Do we really need web socket connection just to collect location info... shouldn't we have web socket only when user is actively using google map. Secondly, if user is not running google map application, will the application be still running somewhere in background to send location?

  • @SamirPatel-dv8xm
    @SamirPatel-dv8xm 4 роки тому +2

    Good Explanation.. Good Job !..
    Que: How Zoom Aggragate video streaming in One UI (on Zoom Client)?

  • @sreenivasulusanduri3453
    @sreenivasulusanduri3453 3 роки тому +2

    Awesome. Very well explained.
    I have a question on the design: Shouldn't we use some kind of graph database (say, Neo4j for example) to store the graph instead of Cassandra?

  • @thegeniusone765
    @thegeniusone765 Місяць тому

    Is this series completed? It was a great series... Keep it going man!!!

  • @abhishekaggarwal9774
    @abhishekaggarwal9774 4 роки тому +2

    Awesome work you are doing. I would like if you can do small videos covering topics like SQL/ NoSQL, Micrososervices, Kafka Messaging Queue etc.

    • @codeKarle
      @codeKarle  4 роки тому +2

      Great suggestion! We'll do that too

  • @kipkip6712
    @kipkip6712 3 роки тому +2

    Amazing work!.. Thank you! So this idea of Exit points on Segments and cutting through exit points to reach destination from source is your own? or is there some reference?

    • @codeKarle
      @codeKarle  3 роки тому +2

      While I did come up with this approach myself, I can't claim that I am the only one who has designed it using this idea, but till the time of recording, I haven't come across anyone else using the same approach.
      I believe Google would be doing something more optimal than this.

  • @shettyanvita
    @shettyanvita 4 роки тому +2

    Thank you for the detailed explanation of the overview architecture. Can you go in-depth for the upcoming vides of the bottlenecks faced while designing DB/ CAP principles tradeoffs i.e. C/A depending on the requirements/product

    • @codeKarle
      @codeKarle  4 роки тому

      Sure, well try to do that

  • @harshavardhanragi6838
    @harshavardhanragi6838 Рік тому

    At 14:44, it doesn't give shortest distance between x and y

  • @JaredBeach94
    @JaredBeach94 2 роки тому

    surprised we use "segments" instead of geohashes

  • @illyam689
    @illyam689 5 місяців тому

    that would take 10 years to implement

  • @astrostudent2302
    @astrostudent2302 3 роки тому +1

    Discussion around - Disputed areas, last bit of inferences like pub goers are social etc..was icing on the cake!!!

  • @piyushshekdar4270
    @piyushshekdar4270 Рік тому

    How is a user location mapped to some point on a road ?

  • @jayeshudhani99
    @jayeshudhani99 3 роки тому +1

    Can you make a video on spark streaming ?

  • @anupampandey3758
    @anupampandey3758 2 роки тому +1

    Thanks for an informative video, Sandeep. Could you also please include the reasoning behind going with specific db choices, external services like hadoop etc instead of a different competitive service?

  • @anmolbhatia2305
    @anmolbhatia2305 3 роки тому +1

    Great video. My question would be regarding what does the data look like which we are storing in Cassandra. For almost all of the storage data you have chosen Cassandra but other factors like data access pattern and what sort of queries will be used on that data should also be considered. It would be great if you can elaborate more on that as well.

  • @pallavibansal84
    @pallavibansal84 4 роки тому +1

    Loved your approach about calculating distances ..

  • @aryanrahman3212
    @aryanrahman3212 Рік тому +1

    After 2 years, still an amazing video!

  • @atintandon9624
    @atintandon9624 3 роки тому +1

    Very smart to include discussion of disputed areas in this video

  • @halterskelter
    @halterskelter 8 місяців тому

    How does this guy know all of this

  • @ankitjain8724
    @ankitjain8724 4 роки тому +1

    Excellent content! One of the best explanation of Google map design ever. But there are too many adds, it would be great if that can be reduced.

  • @nikitasinghchauhan6239
    @nikitasinghchauhan6239 4 роки тому +2

    Thank you for google map . Didn't find any other video on this topic. u did a wonderful job.🙂

    • @codeKarle
      @codeKarle  4 роки тому +1

      Thanks you :)
      Let us know what other videos you'd like to see

    • @nikitasinghchauhan6239
      @nikitasinghchauhan6239 4 роки тому

      @@codeKarle google search 🙂

    • @codeKarle
      @codeKarle  4 роки тому +1

      @@nikitasinghchauhan6239 that would be live soon!!

  • @rajuy18
    @rajuy18 4 роки тому +1

    Amazing bro, I like it, keep it up 👍

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 4 роки тому +1

    Thank you for Sharing

  • @ritubhandarimusic
    @ritubhandarimusic 9 місяців тому

    But how do you identify what all segments you should consider to calculate distance between two points? You traverse through entire graph or say max 10 segments from each direction?

  • @TheMayankrungta
    @TheMayankrungta 4 роки тому +1

    Your all videos are awesome.

  • @roshanpatro5777
    @roshanpatro5777 25 днів тому

    A very helpful one.

  • @zuowang5185
    @zuowang5185 8 місяців тому

    do you keep a ETA heap for each segment? Not sure how you can efficiently bubble up when a road condition is changed.

  • @akshaymonga
    @akshaymonga 2 роки тому

    I wish you had gone through the design from component by component, as the meat of this video was about "segments", usually system design interviews dont happen that way.

  • @DeepakSaini-di7fc
    @DeepakSaini-di7fc 4 роки тому +1

    Great work. It will be great if you can put some content about Google Doc and git design.

    • @codeKarle
      @codeKarle  4 роки тому

      Sure, but that might take a while to be live :)

  • @shubhamgarg4227
    @shubhamgarg4227 4 роки тому +2

    woah!!! awesome work, keep doing that

    • @codeKarle
      @codeKarle  4 роки тому +1

      Thanks for the kind words!! Do share it with your friends :)

  • @RK-xl2uq
    @RK-xl2uq 4 роки тому +3

    great video, i think a little more details on the database schema would have helped more to some readers. At least now i know how google works/worked hypothetically :)

  • @jkl89966
    @jkl89966 2 роки тому

    Hi, can anyone help with this question: System design question to design a heatmap. user can input any range of times (in minutes) and I want to be able to see the density of drivers on the map color coded You don't have to worry about the actual color coding part (assume you have some UI that will take in the count input and do the coloring for you).

  • @RaoVenu
    @RaoVenu 2 роки тому

    Questions about the algorithms being chosen:
    a) In the initial few minutes the presenter mentions Bellman-Ford. Isnt that quite inefficient unless you are trying to look for negative cycles?
    b) Later he mentions Djistkra'a algorithm. Isn't the A* algorithm better as you don't need to evaluate all paths. Additionally, the heuristic could be dynamic based on traffic patterns. My thoughts were you could use A* for finding cost to go to different entry / exit points from inside for lowest level of granularity and then use the same A* algorithm to evaluate cost between different entry / exit points (like intra city travel)

  • @thakurnitesh27
    @thakurnitesh27 Рік тому

    Awesome Video. One question though - shouldn't each segment have separate exit and entry point though? There can be scenarios where exit is allowed(one-way) but not entry. In that case, we would have to maintain exit and entry points for each segment and mega-segment.

  • @hqdevelopers3697
    @hqdevelopers3697 4 роки тому +1

    It would be interesting to tackle not so common system design interview questions also.
    For example, about TinyURL there are a lot of system design videos already.
    It would be challenging to see a system design video about Google Photos for example and how do they manage to provide "unlimited" storage space for Pixel users (at least).

    • @codeKarle
      @codeKarle  4 роки тому +2

      Those are coming soon

    • @sushilrawat502
      @sushilrawat502 10 місяців тому

      @@codeKarle will you be producing more content ?

  • @amrtahlawi
    @amrtahlawi 3 роки тому

    Thank you for the helpful tutorial. qq: why are you using Cassandra for the Graph Processing service? shouldn't you be using a graph DB like Neo4j? As far as I know, Cassandra is a wide-column DB, not a graph DB.

  • @harendrapratapsingh8210
    @harendrapratapsingh8210 2 роки тому

    can you please explain why you are using Cassandra as a persistent storage for the graph service?
    Can we use any graph db for the purpose like neo4J?

  • @sakshamsrivastava6280
    @sakshamsrivastava6280 2 місяці тому

    Hat's off Man!

  • @anilkatakam2738
    @anilkatakam2738 2 роки тому

    On the Disputed Areas- what if user see the map from some other country? how do google decide boundaries?

  • @ajayk9929
    @ajayk9929 2 роки тому

    Sandeep Kaul Sir ,all your videos are extremely useful for design preparation. if possible please speak little slow or pause for some seconds. Thanks in advance.

  • @elachichai
    @elachichai 3 роки тому

    Nice Sandeep. Hope to see more content from you, but scoped to 35 min. But this one was informative to every minute and a nice write up!
    Mega Segments: Are you meaning to say that in creating a route from Bengaluru to Mumbai, the constituencies or taluks along the way don't matter in that " outer layer" of computation because those have been reduced to a point (Sholapur or Kolhapur) in that layer where we apply the algorithm? This means something like min of a sum ~= generally a sum of minimums, which avoids end-to-end (massive, over) computation for little to no gain (in fact losing computation time, storage). O(nlogn) is >> O(mlogm) + O(klogk) + .. where m,k are < n (may add up to n). I didn't mean to get into maths, but that is what we are looking at in breaking a continuous spectrum of points to discrete points for each outer layer. Is this about accurate?
    I don't see you use spatial database like quadtree. What is your opinion?
    So long the Djikstra's algorithm is applied between cities, it picks up the best cached routes for the exit points of the cities of Sholapur or Kolhapur.

  • @anandt8362
    @anandt8362 3 роки тому

    Thanks for the video.. 1. If the user changes from the route suggested how the re-route will be calculated and made visible ? Which particular service will be responsible for it?

  • @lavkushtiwari2799
    @lavkushtiwari2799 2 роки тому

    Firstly thanks for this lovely channel. The explanations are so good.
    I have a doubt: Can Map Service have a Cache so that if multiple people are asking for same location it doesnt need to ask for route to Graph Processing service?

  • @rajatahuja4720
    @rajatahuja4720 4 роки тому

    Websocket handler/manager is primarly required in the navigation flow not while collecting the lat/lon of users. what do you think ?

  • @RekhaS-t9p
    @RekhaS-t9p 7 місяців тому

    Amazing content

  • @mukeshknit3494
    @mukeshknit3494 2 роки тому

    Awesome and details content. Can you make a video about distributed scheduler ?

  • @andriidanylov9453
    @andriidanylov9453 Рік тому

    Very strong presentation. Actually the best what I have seen about this topic. Appreciate.

  • @JohnWick-to6nr
    @JohnWick-to6nr 2 роки тому

    How does this approach (considering exits) help in reducing time complexity on the whole, as we are internally applying floyd-warshall for each segment to get the minimum distance between exits of every segment in between and then using this information to build a graph?

  • @MithunKumar-xy9pp
    @MithunKumar-xy9pp 3 роки тому

    Can you please explain how did u come up with this design? What resources did you follow?

  • @ravbhaj
    @ravbhaj Рік тому

    Very comprehensive!!
    Liked the "Summary of this video" too.

  • @MaggieMa2138G
    @MaggieMa2138G 2 роки тому

    What is the data schema for the Cassandra that is attached to the Graph Processing Service?

  • @dipanshuasri
    @dipanshuasri Рік тому

    How to calculate the exit point of segment ? ( e.g. s1e1 )

  • @elachichai
    @elachichai 3 роки тому

    Can you please make a video of how payment systems work? Say Design Square or Design Visa.

  • @andybhat5988
    @andybhat5988 2 роки тому

    Super explanation of a very complex system. Thank you

  • @SaiPavanPothuri
    @SaiPavanPothuri 2 роки тому

    When to use Cassandra ? and when to use hadoop ?
    any differences ?

  • @meganfoxyish
    @meganfoxyish 2 роки тому

    Great Effort to put all the complex pieces together. As we all agree google maps is one of the complex designs in the world and you have done justice to explain this is best possible way. Great Effort.

  • @ir0nt0ad
    @ir0nt0ad 3 роки тому

    Thanks a lot for your work! I believe the word you're looking for is "cell" (5:56)

  • @princetoncross-culturaledu1315
    @princetoncross-culturaledu1315 2 роки тому

    I wonder if a video about stock trading systems can be made?

  • @greuser
    @greuser 3 роки тому

    I didn't understand the difference between theoretically calculated road and cached or real roads? Could you explain?

  • @samarthgupta7845
    @samarthgupta7845 4 роки тому

    Very nice explanation. Content is really good. This kind of content is not there anywhere on the internet. Can you please make a video on how distributed message queue works?

  • @princetoncross-culturaledu1315
    @princetoncross-culturaledu1315 2 роки тому

    I love the content! Could you please make video about databases and streaming systems?

  • @trendingbuzz9974
    @trendingbuzz9974 3 роки тому

    Could we use zookeeper instead of web socket manager?

  • @rohitvishwakarma9261
    @rohitvishwakarma9261 4 місяці тому

    Thanks for keeping the explanations simple. I have seen some videos where people just bombard with jargons reducing interest.

    • @coding8696
      @coding8696 3 місяці тому

      Can i start this series with basic information about System Design?

  • @MrGaurabpaul
    @MrGaurabpaul 3 роки тому

    Good video. One suggestion : you could add a section on how search works in google maps. Chinese restaurants near me or best 5 star hotels near bus stop?

  • @sureshchaudhari4465
    @sureshchaudhari4465 2 роки тому

    headphone model brand batao voice quality is nice

  • @rishikeshkmr
    @rishikeshkmr 2 роки тому +1

    Perfect!

  • @rahulkushwahafarzirahu
    @rahulkushwahafarzirahu 3 роки тому

    Thanks for this awesome video. Next would like some LLD videos too.

  • @navjan13
    @navjan13 3 роки тому

    So spark streaming is consuming as well as writing back to kafka? or are we going to create a different kafka for that?

  • @alikarooni9713
    @alikarooni9713 Рік тому

    Thanks you. Nice explanation

  • @techatnyc7320
    @techatnyc7320 Рік тому

    Thank You

  • @rahulchudasama9363
    @rahulchudasama9363 3 роки тому

    Awesome explaination ...
    This channel will become a boom ...

  • @puneetagrawal9956
    @puneetagrawal9956 3 роки тому

    This was a really awesome video. The first 40 min. were gem

  • @seeva92
    @seeva92 4 роки тому

    This can be further extended to series of parts. Especially, I am little more interested in the creation of segment, underlying data model of it, persistence logic, and updating the segments. When to increase the current segment range? When to break the current segment range to smaller segments?

  • @Downicon3
    @Downicon3 Рік тому

    Thank you, quite insightful

  • @EpNews-5012
    @EpNews-5012 Рік тому

    Thanks!

  • @jayeshudhani99
    @jayeshudhani99 3 роки тому

    Are we expected to solve this completely for a typical SDE-2 role having 3 years experience ? because this was a lot to digest for me.

    • @codeKarle
      @codeKarle  3 роки тому

      Not all of it, but a good portion of it. For an SDE-2, you could skip out analytics and the big data portion completely, and still get a positive feedback. All of it would be required in-case you are applying for an Architect role.

  • @knpatel86
    @knpatel86 3 роки тому

    Thanks for the amazing series. I would just recommend going with simple design problems to start with and increment the complexity for beginners. Thanks

  • @amollopes7960
    @amollopes7960 3 роки тому

    Really good video, all parameters considered 👍

  • @twarzo
    @twarzo 3 роки тому

    This is an awesome system design video given the scope and difficulty of the problem. One suggestion I had was to also add link of slides or screenshots of the diagram drawn at different stages of the video :)

  • @作业本-z1s
    @作业本-z1s 3 роки тому

    super。learning new knowledge,ilove it

  • @alanwsx
    @alanwsx 3 роки тому +4

    This is a very solid 1-hr content!