I've got the 5th edition and just went over the answer for this question: > How would you design the data structures for a very large social network like Facebook or LinkedIn? Describe how you would design an algorithm to show the connection, or path, between two people (e.g., Me -> Bob -> Susan -> Jason -> You). The answer provided is basically distributed BFS, which is fine. But the answer doesn't address at all a) limiting the search to a few degrees of separation or b) doing the BFS in real-time vs pre-computing it. If you do the BFS in real-time when the user is loading someone's profile page, potentially searching millions of nodes, it's too slow. If you pre-compute the paths, then you need to consider how to store them and when to pre-calculate them. Does the answer for this one miss the mark?
Zuck actually delivered a lecture on this and how FB solve, look up CS50 on YouTube
About 5 years ago I emailed the author a list of errors I found in the book. You can reach out to her and she will gladly fix them in the next edition.
Ctci is inadequate for system design topics. Look elsewhere
You know its just speculation from her side right? How Facebook actually does it is way more complicated and proprietary knowledge. What she is proposing and what you are talking about might not be the case of reality at all.
I also wouldn't expect an interviewee to on the spot design an highly optimized version. But I would expect some discussion of aspects that need to be improved and how might do it.
India
Yesterday
1946
Please vote sensibly 🙏
Software Engineering Career
4d
44142
Offer Evaluation: Meta v NVIDIA v Coinbase
Tech Industry
Yesterday
1003
Chances of meta clearing E5 with screwing up one coding one round and acing all other
2024 Tax
Yesterday
4769
Biden’s new tax proposal is wild
Tech Industry
2d
55827
Goog Employees Arrested
I always assumed this was why LinkedIn limits to 3rd degree connections. Does a bloom filter help here at all?
I'll have to read up on bloom filters -- not sure yet 😱
Bloom filters only support insertions no deletions. At least vanilla version.