由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - y的电面面经
相关主题
报个z******ts的onsite面经yelp电面面经
g家店面面经,求bless长年潜水,回馈FLG面经
回报本版,前段时间骑驴找马FGU等公司offer面经总结【已更新FGU】发点面经回馈下本版的帮助
电面面经G电面面经
U电面经历Amazon电面面经
某家面经贡献一个amazon的电面面经
发几个面经(7) Google 电面+onsiteMicrosoft's interview questions
Amazon电面面经ebay二轮电面面经
相关话题的讨论汇总
话题: timestamp话题: message话题: name话题: business话题: sammy
进入JobHunting版参与讨论
1 (共1页)
t*8
发帖数: 14
1
收到的消息的结构如下
# Message examples:
#
# (business_name, ip, timestamp)
# (“sammy’s”, 82.13.31.123, 1402341603)
# (“sammy’s”, 82.14.34.125, 1402341513)
# (“osha thai”, 92.13.14.12, 1402341523)
每5秒钟收到新消息,调用process_message。要实现一个函数business_name返回10分
钟内出现次数最多的business_name。
# refresh time: 5 seconds
# window: 10 minutes
#
# def process_message(message):
# pass
#
# def business_name():
# pass
z*******o
发帖数: 4773
2
idea?
j**********3
发帖数: 3211
3
y是哪个,雅虎么?
e***i
发帖数: 231
4
Yahoo?
Yelp?
YellowPage?
Yo?
YouTube?
t**r
发帖数: 3428
5
每个访问者维护一個queue. 每次访问往queue里加add。 每5秒pop所有的queue一次.
queue最长的就是了
l******s
发帖数: 3045
6
seems similar to LRU cache
maintain a hashmap and listnode<{business_name, timestamp[]}, count =
timestamp.count>
at every refresh:
1. add or insert new node to a node in timestamp[] from message stream
2. traverse each node to remove timestamp of 10 mins ago (timestamp is a
sorted array)
3. on event of adding/inserting/removing timestamp, move node to sorted
position.
Plus: use ReaderWriter to make sure thread safe
t*8
发帖数: 14
7
是yelp
1 (共1页)
进入JobHunting版参与讨论
相关主题
ebay二轮电面面经U电面经历
sumo logic的开放型设计题,设计一个cache system某家面经
LRU Cache Question发几个面经(7) Google 电面+onsite
[google面试题] API流量控制Amazon电面面经
报个z******ts的onsite面经yelp电面面经
g家店面面经,求bless长年潜水,回馈FLG面经
回报本版,前段时间骑驴找马FGU等公司offer面经总结【已更新FGU】发点面经回馈下本版的帮助
电面面经G电面面经
相关话题的讨论汇总
话题: timestamp话题: message话题: name话题: business话题: sammy