n*e
2 楼
co-ask
p*2
4 楼
这东西被大家讨论烂了。自从我上论坛以来就没有再讨论过。
g*e
5 楼
given a logfile
a A
b B
a B
c E
a C
where left column is user ID, right column is page ID
find the most frequent pattern of 3 consecutive page visits of all the users.
Solution:
two hash table:
1. indexed by user, entry content=previous two visit page IDs of the user
2. store the count. indexed by 3 page IDs? cannot remember...
a A
b B
a B
c E
a C
where left column is user ID, right column is page ID
find the most frequent pattern of 3 consecutive page visits of all the users.
Solution:
two hash table:
1. indexed by user, entry content=previous two visit page IDs of the user
2. store the count. indexed by 3 page IDs? cannot remember...
E*t
6 楼
原题是这样的
给你一个大log 文件,只有两个列,user id 和page number举一个简单的例子:
User ID Page #
A 1
A 2
A 3
B 2
B 3
C 2
B 4
A 4
对于A有
A连续访问了 1->2->3
2->3->4
对于B
2->3->4
对于C
2
那么最经常访问的三个连续的页面为 2->3->4
。
我知道两个hash table来搞。
我的问题是:
user id 和 两个顺序page组成的hash table是怎么建立的。能直接用STL的map么,还
是必须自己写data structure?
谁能轻轻丢个链接,谢谢~!
给你一个大log 文件,只有两个列,user id 和page number举一个简单的例子:
User ID Page #
A 1
A 2
A 3
B 2
B 3
C 2
B 4
A 4
对于A有
A连续访问了 1->2->3
2->3->4
对于B
2->3->4
对于C
2
那么最经常访问的三个连续的页面为 2->3->4
。
我知道两个hash table来搞。
我的问题是:
user id 和 两个顺序page组成的hash table是怎么建立的。能直接用STL的map么,还
是必须自己写data structure?
谁能轻轻丢个链接,谢谢~!
g*e
8 楼
当然是直接调用啦,这题考点不是怎么写hash table。
h*e
13 楼
乍一看标题还以为面试亚麻三次。
t*e
14 楼
One table, user id to 3-element queue.
Make a unique key for each different 3-element, second table is from this
key to its count.
Make a unique key for each different 3-element, second table is from this
key to its count.
p*2
15 楼
对了。第二个hashtable应该用个BST吧?
相关阅读
急:CPT申请要与课程相关怎么办有没有人写过fuck you letter ?H1B premium process 要多久能批下来--急问!我这水平的靠谱吗各大公司的小黑屋是多久?Re: 被删预测重贴:20130726,AAPL,412.22,440.87,444.40, (转载)写个面经 分享一些题目OPT extension期间 H1B transfer?亚麻offer求教Re: 女大学生花3万赴美实习洗厕所 因此经历考研被录 (转载)一道面试题求解如果不受h1b cap的话,想要保住身份,是不是随便找个学校就可以T家系统/平台组面试会考些什么?限时特惠Barclay Arrival 万事达世界卡免费送400美金,首年无年费不会Java,后果多严重?LinkdIn面经有周日下午四点多去面试的么?!感觉很奇怪。该看leetcode,还是poj什么的水题?土人求问,哪儿投简历C的店面