n***a 发帖数: 222 | 1 板上好像没人发过, 大家讨论一下:
Design a system to hand out telephone numbers for Google voice.
You want to present numbers to people such that:
a person sees 10 numbers at a time
no two people should see the same numbers at the same time
they get 2 minutes to choose one of those numbers or ask for more. If they
choose one after the 2 minutes are expired, the request fails.
Where you would put the various data elements - in a database, application
servers, front-ends or the browser.
What kinds of data structures you would use. |
g*****g 发帖数: 34805 | 2 一个RDBMS就搞定了,显示10个号码的时候打上用户名和时间戳,对电话号码索引。
【在 n***a 的大作中提到】 : 板上好像没人发过, 大家讨论一下: : Design a system to hand out telephone numbers for Google voice. : You want to present numbers to people such that: : a person sees 10 numbers at a time : no two people should see the same numbers at the same time : they get 2 minutes to choose one of those numbers or ask for more. If they : choose one after the 2 minutes are expired, the request fails. : Where you would put the various data elements - in a database, application : servers, front-ends or the browser. : What kinds of data structures you would use.
|
g******o 发帖数: 10 | 3 如何找到the next 10 available numbers |
l******s 发帖数: 3045 | |
u***n 发帖数: 21026 | 5 用lock不可以吗,require的时候好比是 write,拿到lock后才能对这些号码操作,2分
钟后失效,remove lock,后面的人就能看到了。 |
n*******s 发帖数: 17267 | 6 10个号码没说清楚,估计是都不能重复,这题挺简单的,不过可以引出来比较有趣的话题
【在 l******s 的大作中提到】 : 我很笨,看了半天没明白题意,求教讲解?
|