问一道FB design之后续# JobHunting - 待字闺中
n*y
1 楼
原帖在这里: http://www.mitbbs.com/article_t1/JobHunting/33285661_0_1.html
今天跟FB专门做privacy setting一美国大牛又聊到了这个问题,跟他讲了之前大家讨
论的“post to friends' timeline”的想法。他的回复是:
This can be done simpler, without any extra writes.
A hint: You are thinking about the problem as "How to check if C is a friend
of friends of A". But it is possible to rephrase the question in an other
way which will make the problem much simpler to solve.
大家怎么看?
PS: 再把题目贴一下
privacy setting. 说是每个user有一个friend
list, user可以发Post, 问如何设计Ouser friends的friends可见,时间复杂度O(N)
今天跟FB专门做privacy setting一美国大牛又聊到了这个问题,跟他讲了之前大家讨
论的“post to friends' timeline”的想法。他的回复是:
This can be done simpler, without any extra writes.
A hint: You are thinking about the problem as "How to check if C is a friend
of friends of A". But it is possible to rephrase the question in an other
way which will make the problem much simpler to solve.
大家怎么看?
PS: 再把题目贴一下
privacy setting. 说是每个user有一个friend
list, user可以发Post, 问如何设计Ouser friends的friends可见,时间复杂度O(N)