Yelp system design | amazon interview question Yelp software architecture

  Рет қаралды 80,697

Tech Dummies Narendra L

Tech Dummies Narendra L

Күн бұрын

Let's design a Yelp/Tripadvisor/ any location-based service, where users can search for nearby places like tourist places, restaurants, theaters, or markets, etc.
users can log in and can also add/view comments, photos, and reviews of places.
#yelpsystemdesign
#yelpsoftwarearchitecture
System design: imgur.com/a/rq7r3VE

Пікірлер: 82
@adamhughes9938
@adamhughes9938 3 жыл бұрын
I really liked this format where you kind of lay out their system architecture and talk through it. This is especially helpful for studying and is a nice contrast to your other videos where you sort of work it out on a whiteboard. Both are very helpful, but right now I'm trying to just cram designs into memory more than figuring them out myself. Thanks for great content on both of these fronts! You should start a business.
@JM_utube
@JM_utube 4 жыл бұрын
there is SO MUCH GOING ON in this video. unbelievable. thank you for posting.
@judening2614
@judening2614 4 жыл бұрын
Sir, thank you again for the good work. You definitely deserve more subscribers!
@meghadave9363
@meghadave9363 3 ай бұрын
every moment of your content is so engaging. if you miss a moment , you miss knowledge
@ShabnamKhan-cj4zc
@ShabnamKhan-cj4zc 3 жыл бұрын
Amazing video..Your every video provide a new concept to learn which is not easily avilable. Thank you so much Narendra for doing all this work and sharing knowledge..
@deshpandenilesh12
@deshpandenilesh12 3 жыл бұрын
I really like your video's. So much data explained in simple terms
@huseyinbarin1653
@huseyinbarin1653 2 жыл бұрын
Perfect! Thanks a lot. Just wonder that should we put a LB in front of the web tier as we did in the data tier?
@romanoadler4990
@romanoadler4990 4 жыл бұрын
Another great video on the channel on system design. Thanks!
@harrygk2377
@harrygk2377 3 жыл бұрын
I would like to learn this space/stay in touch with experts in this space. is there a common social media or collaborative tool that you would like to meet ? my email id : harishgk201@gmail.com
@ashishd89
@ashishd89 4 жыл бұрын
Brilliant stuff. Thank you for all your videos. Can you make video on system design of food delivery apps like zomato, swiggy or uber eats?
@emmalu3891
@emmalu3891 3 жыл бұрын
Thank you for the good video! A Question: Does a company take 256 bytes of space? I think a letter takes about only 2bytes for UTF-8. is that correct?
@navroze92
@navroze92 2 жыл бұрын
Hi, Naren thanks for the awesome explanation. One thing I did not understand based on what criteria are dividing the box is it by distance is it by a number of places and at what point do we stop dividing the boxes.
@user-ow9iy5zt1i
@user-ow9iy5zt1i 2 жыл бұрын
Thanks so much. Great stuff and explained very well
@saadaqnuurgeedi7777
@saadaqnuurgeedi7777 3 жыл бұрын
that is well illustrated inside outside of the hall industry Thanks
@naecinfonaec5128
@naecinfonaec5128 4 жыл бұрын
Excellent stuff. Some texts on Diagram hard to read, it would be great if you have a better resolution diagram
@Rafbasketball
@Rafbasketball Жыл бұрын
Great stuff - thank you so much long video but watched till the end!
@lolopolos
@lolopolos 3 жыл бұрын
Excellent and detailed !!
@timzhu
@timzhu 3 жыл бұрын
Good video, but the meat of location indexing doesn't start until 40minutes. I recommend you splice this video and put up another one that 's focused on how locations are indexed and searched through Quad trees.
@vivek9876
@vivek9876 4 жыл бұрын
Brilliant stuff. Appreciated your hard-work .one thing to note, Tree representation to find the most closest box has to be quadtree, with binary tree we cant solve it.
@bowang1825
@bowang1825 4 жыл бұрын
+1 you should mention quadtree first
@stillyi
@stillyi 3 жыл бұрын
You are saying a box should be in one server. When you break up the box because there are too many places in it, you break up the box into 4 boxes. Do you immediately add 3 more servers to host the other 3 boxes?
@AbhishekSharma-si8ui
@AbhishekSharma-si8ui 4 жыл бұрын
AWESOME
@adamhughes9938
@adamhughes9938 3 жыл бұрын
Your description seemed to imply elasticsearch would be a sufficient storage solution, but looks like they went with Cassandra regardless. Wonder why
@PatrickDesjardins1
@PatrickDesjardins1 2 жыл бұрын
Hi Adam. I cannot talk for the author but Cassandra is a better choice when data is replicated over multiple regions. From what I know, ElasticSearch does not have good stories around choice like having an active/active system. Hence, Yelp could benefit of having Cassandra has it scales well. ElasticSearch is also not as reliable as Cassandra when writing. The author mentions that consistency is not a non-functional requirement but still, it seems to be a common pattern to send the data into Kafka which will write into Cassandra and ElasticSearch where the former is the main source of persistence and the latter the way to search the data (which might have only a subset like name + lat/long). I would recommend not to host your main information in ElasticSearch.
@viditmathur8437
@viditmathur8437 3 жыл бұрын
great video
@BikasKatwalK
@BikasKatwalK 4 жыл бұрын
I am a bit confused about the circle you drew(47:00). I understand we can use something like a quadtree to find the rectangle. 1. how did you draw the circle? 2. Even if I have the 4 coordinates of the rectangle, say of size 2*2 KM. How will I know which all points I need to query inside that rectangle?
@TechDummiesNarendraL
@TechDummiesNarendraL 4 жыл бұрын
Its a recursive process of finding all the boxes intersects with circle. 1. Go reverse from the point and calculate the current index-box corners 2. If the min distance to one of corner is less than the search radius, keep repeating for all the index-boxes in parent index box
@namanmishra5448
@namanmishra5448 3 жыл бұрын
@@TechDummiesNarendraL Min distance to corner might not work always. There can be a case where distance to corner is greater than search radius but still the circle intersects with nearby box/boxes. Also, till what point do we keep traversing the tree updwards to check interstection? There can be an edge case where a point is very near to a box that is much up in the tree hierarchy. How to handle that?
@rahulchudasama9363
@rahulchudasama9363 4 жыл бұрын
Awesome Naren, Many things are clear in my mind just because of you. Can you make video on the System design of leetcode or something like that platform?
@bowang1825
@bowang1825 4 жыл бұрын
ping
@vernerdsouza8559
@vernerdsouza8559 2 жыл бұрын
Great explanation overall. I have one specific question: How do you find the intersecting boxes once you get to a specific box? Ie, how do you get all the intersecting boxes based on the search radius of the current box?
@skyFullOfStars
@skyFullOfStars 10 ай бұрын
you can do DFS on a tree and find the node. while doing so, at every node you can compute distance from node to the point, at some suitable node (which will be ancestor of node we are searching for ) you can stop and grab all its children. this is just first thought, but once you have a tree, you can play around it however we want
@hazdazzler
@hazdazzler 3 ай бұрын
this was fantastic, thank you!
@stillyi
@stillyi 3 жыл бұрын
Elastic search does not guarantee no data loss. It should not be the primary data source from my understanding..
@laracroft9079
@laracroft9079 2 жыл бұрын
it's so funny when you drag your picture up and down in the beginning of the video.
@anuragagnihotri5238
@anuragagnihotri5238 2 жыл бұрын
Nice explaination
@jay-rathod-01
@jay-rathod-01 3 жыл бұрын
Hello sir, really we have to explain the interviewer the whole architecture.
@vivekrao7650
@vivekrao7650 3 ай бұрын
Thank you for detailed explanation
@aditishete5326
@aditishete5326 24 күн бұрын
Excellent!
@Dan-tg3gs
@Dan-tg3gs 3 жыл бұрын
Doesn’t integer have 4 bytes? So shouldn’t lat + long be 8 bytes, not 16?
@poonamgoel7145
@poonamgoel7145 4 жыл бұрын
The video content is explained very well. Thanks for making this video. One question: don't we have to worry about the time it takes to find a perfect box (when it's finding the first bigger box, then second and so on..) ?
@manishsrms
@manishsrms 4 жыл бұрын
Even if we divide our boxes in two halves and we've 20 million boxes, than even we'll only have to query log2(20000000) = 24 (log (base 2) 20 million, approximately) queries to find correct box. So it's mostly negligible. And if we use quad tree instead of binary tree it will be further optimized :)
@vivek9876
@vivek9876 4 жыл бұрын
@@manishsrms Fining a node in a quartree structure has more runtime complexity compare to binary tree but here we cant use binary tree we have to use quadtree to solve this.
@cosmos1651
@cosmos1651 3 жыл бұрын
@@vivek9876 Can you explain why searching in quartree structure has more runtime complexity? Shouldn't it be log4(n) which is lower?
@vivek9876
@vivek9876 3 жыл бұрын
@cosmos check this out www.geeksforgeeks.org/binary-search-preferred-ternary-search/ So same way search in binary tree has less runtime complexity compared to search in quad tree.
@shinningloser1720
@shinningloser1720 2 жыл бұрын
could you please share link of indexing video you are talking about.
@archtaqi
@archtaqi 4 жыл бұрын
which tool u are using for making diagrams?
@TechDummiesNarendraL
@TechDummiesNarendraL 4 жыл бұрын
Draw.io Microsoft white board Dell Inspiron touch screen
@rahulsharma5030
@rahulsharma5030 3 жыл бұрын
excellent stuff. I need one clarification: How did u draw find all intersecting boxes?I am at a point ,how can i get the boxes, which lie of circle with radius R from current point?I think u missed to explain that or may be i am missing something,Please help
@QuestionableCoding
@QuestionableCoding 3 жыл бұрын
I can think about the following way: We can turn ourselves from one point to 4 points by using the radius. Let's say we are located in point (10;12). If we want to find everything in a radius = 5, we will create a square with coordinates (10 - 5; 12 - 5) (10 - 5; 12 + 5)(10 + 5; 12 - 5) and (10+ 5; 12 + 5). Which equals to a square with coordinates (5; 7) (5; 17) (15; 7) (15; 17) . After that while searching for a proper box in our tree, we will compare box coordinates with our square coordinates. And we'll have many boxes right away. Also there is a way to represent a 2d plane as a line to search on but it is out of scope.
@chethan1391984
@chethan1391984 3 жыл бұрын
This is the most difficult problem to solve. Because, 1) the circle has infinite points to check 2), the intersecting boxes can be part of a whole different sub tree It would be nice, if he had explained this a bit more.
@chethan1391984
@chethan1391984 3 жыл бұрын
@Questionable Coding - I think your solution also faces the same problem. With 4 points, you only get 4 boxes. If you need all the boxes, within square, you again need to search each and every co-ordinate between lat and longs of the square's co-ordinates. The straight line method is called Hilberts curve, i believe
@QuestionableCoding
@QuestionableCoding 3 жыл бұрын
@@chethan1391984 But I think we should use all four points in comparison and not use them separately. It will be the task of telling if one square intersects with another. I think we can do it.
@rahulsharma5030
@rahulsharma5030 3 жыл бұрын
@@QuestionableCoding Let us say we got 4 boundary cordinates let us name them Acord,now we need to traverse entire tree again to find Acord in tree and then find its four cordinates and repeat the process. It too much of complex stuff. What if we have a parent pointer from child to parent?When we find the cell in which customer exits, we take those locations and then move to parent and it checks all its children and then we move to grand parent and so on.Both you and mine approach may take same time.But i think it is less simpler.Although practical solution might be doing some more crazy stuff
@anantkaushik6086
@anantkaushik6086 Жыл бұрын
hi Naren. Though i liked your video, I would say that there were some generic statements which you ended up stating in the video which I am not sure an interviewer would agree with. Like NoSql better for larger datasets. My only feedback is that you do give some context as to why your statement is valid and whats the backing concept behind it.
@senx8758
@senx8758 3 жыл бұрын
quad tree is not correctly explained. actually quad tree query might search four child, if the search range is in corner.
@ReadyReviews
@ReadyReviews 2 жыл бұрын
nice
@zhongyuanzhang5611
@zhongyuanzhang5611 3 жыл бұрын
you can cache the coordinates, because the service doesn't need to be 100% accurate, gps doesn't have perfect precision anyway, what you can do is to normalise the location to be a predefined point.
@avrillovugne
@avrillovugne 2 жыл бұрын
sir thank you so much, tomorrow system design interview, marathon your video now
@maxageev6931
@maxageev6931 6 ай бұрын
32 bytes for ID or UUID? I think it overkill you mean 32 bits for uuid it would be 64 bits
@losikov
@losikov 3 жыл бұрын
9:30 - CDN doesn't affect number of requests hitting the backend API server. Don't mislead people with false information. CDN is for static content cache (video, images) on provider sider. In simple words, not to stream Netflix from somewhere in data-center, the video is streamed right from your provider network (next building to you in a big city). Before, Netflix mailed their servers directly to all providers. 10:57 - number of requests per seconds can't be used alone as a reason for choosing NoSQL over SQL. Both should be scaled and have different techniques to scale with its own pros/cons, and those should be considered. Yes, you can say that but only considering other requirements including maintenance & development cost. No reason to continue watching.
@pramalvi
@pramalvi Жыл бұрын
I had the same doubt regarding caching API requests using CDN. Upon some research I found that information is valid. While CDNs are primarily designed for caching static content, they can be configured to cache API responses and provide performance benefits for API requests as well.
@nilmaniprashant4389
@nilmaniprashant4389 4 жыл бұрын
If possible,can you please make a video on Tiktok system design.
@sekobey1983
@sekobey1983 4 жыл бұрын
Hi, Can you please design AWS S3 HTTP PUT or POST Rest API? Requirements: 1. This API gets binary data 2. It is connected to 100 data centers. 3. Each data center has 1000 hosts. 4. Each host has 1000 disks. 5. Hosts and disks may crash. 6. API has 30 milliseconds to decide to write coming binary data to available disk.
@amlanch
@amlanch 2 жыл бұрын
Could you please get a nicer microphone or atleast wrap it around with wool or glass fiber so environmental noise is less? The sound changes so much echo and noise wise during the presentation it can get really distracting. Of course as usual your material and presentation is A+++ category
@payadav
@payadav 3 жыл бұрын
Some imp stuff missing in the design - your idea will lead to unbalanced sharding. Some of the grids will represent Atlantic or Ocean and some very busy city containing thousands/millions of places. Who would to balance the queries.
@kobew1351
@kobew1351 3 жыл бұрын
i'm actually not sure why he wants to shard the grid tree, is this tree size really such big?
@zhongyuanzhang5611
@zhongyuanzhang5611 3 жыл бұрын
you shouldn't be using elastic search as primary storage
@johnnyzhao2668
@johnnyzhao2668 3 жыл бұрын
thank you so mush
@priyakantpatel6866
@priyakantpatel6866 3 жыл бұрын
The Quadtree explanation is not that clear, you might what to reconsider or re-record that section. my 2c!
@rahulsharma5030
@rahulsharma5030 3 жыл бұрын
yeah thats was the most important part of this design.Some concepts are missing there.Like how exactly we draw that circle and complete flow of the search query would have been better
@logicboard7746
@logicboard7746 2 жыл бұрын
Spatial search @38:00
@lemp9582
@lemp9582 2 жыл бұрын
This guys already prepared what to show us, in the real interview you cant prepare any system arch that you might face. The actual point is to think a simple solution, this vidoe is helpful are reference but not an ideal answer.
@tblaster8522
@tblaster8522 4 жыл бұрын
Nice video BUT there is too much beating around the bush. Please keep it straight to the point. Just count how many times you said "How do you find ..?" you'll know what I mean.
@adamhughes9938
@adamhughes9938 3 жыл бұрын
I disagree with this - I think the video is spot on.
@sumonmal009
@sumonmal009 3 жыл бұрын
THIS COMMENT IS FOR MY PERSONAL REFERENCE. TO UNDERSTAND PROPERLY WATCH THE FULL VIDEO -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- requirement 3:15 estimation 3:45 DB choice 8:30 12:40 Mongo vs ES 14:00 HLD 16:37 Special search solution 35:29 actual solution 42:01
@ayushpathak2484
@ayushpathak2484 2 жыл бұрын
Kuch bhi bol dena using lots of fancy technical terms....if you don;t know something at least do some research instead of creating misleading content
@AbhishekSharma-si8ui
@AbhishekSharma-si8ui 4 жыл бұрын
AWESOME
Paste bin system design | Software architecture for paste bin
31:20
Tech Dummies Narendra L
Рет қаралды 64 М.
Пробую самое сладкое вещество во Вселенной
00:41
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 71 МЛН
Whatsapp System design or software architecture
27:40
Tech Dummies Narendra L
Рет қаралды 251 М.
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1 МЛН
Event Driven Architectures vs Workflows (with AWS Services!)
15:49
Be A Better Dev
Рет қаралды 89 М.
System Design Interview: Design Ticketmaster w/ a Ex-Meta Staff Engineer
58:39
Hello Interview - Tech Interview Preparation
Рет қаралды 43 М.
Event Driven Architecture | System Design
14:59
techwithshakul
Рет қаралды 28 М.
System Design Interview Walkthrough: Design Twitter
23:04
Hello Interview - Tech Interview Preparation
Рет қаралды 23 М.
System Design Interview: Design Uber w/ a Ex-Meta Staff Engineer
1:03:05
Hello Interview - Tech Interview Preparation
Рет қаралды 37 М.
Пробую самое сладкое вещество во Вселенной
00:41