由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 亚麻 三连击
相关主题
亚麻面经universal hashing的问题
三连击rebuild a tree from inorder and level order
STL doesn't have hash Table?Amazon 电面
弱弱的问问跟hash有关的问题A公司面挂了,发面经,攒RP
Amazon面经Re: 别了,纽约 (转载)
amazon版上面试问题请教大家帮忙看看 问题在哪啊?由preorder 来建 bst,为什么后面没
问两道amazon的面试题问一道题~
amazon三连击这题要怎么设计hash function呢?L家 index设计题
相关话题的讨论汇总
话题: user话题: page话题: table话题: hash话题: ids
进入JobHunting版参与讨论
1 (共1页)
E******t
发帖数: 660
1
知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比
较详细得帖子。大家能不能给个link啊,多谢多谢?
n****e
发帖数: 678
2
co-ask
t**********h
发帖数: 2273
3
把原题贴一下?

【在 E******t 的大作中提到】
: 知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比
: 较详细得帖子。大家能不能给个link啊,多谢多谢?

p*****2
发帖数: 21240
4
这东西被大家讨论烂了。自从我上论坛以来就没有再讨论过。
g*********e
发帖数: 14401
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...
E******t
发帖数: 660
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?
谁能轻轻丢个链接,谢谢~!
G*********t
发帖数: 71
7
您是背送下来的啊?

users.

【在 g*********e 的大作中提到】
: 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:

g*********e
发帖数: 14401
8
当然是直接调用啦,这题考点不是怎么写hash table。
p*****2
发帖数: 21240
9

users.
不错。

【在 g*********e 的大作中提到】
: 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:

g*********e
发帖数: 14401
10

随便写写罢了,对错还不知道呢。

【在 G*********t 的大作中提到】
: 您是背送下来的啊?
:
: users.

相关主题
amazon版上面试问题请教universal hashing的问题
问两道amazon的面试题rebuild a tree from inorder and level order
amazon三连击这题要怎么设计hash function呢?Amazon 电面
进入JobHunting版参与讨论
b******t
发帖数: 965
11
还去不去亚麻的?

【在 g*********e 的大作中提到】
:
: 随便写写罢了,对错还不知道呢。

g*********e
发帖数: 14401
12

9成去。

【在 b******t 的大作中提到】
: 还去不去亚麻的?
h****e
发帖数: 928
13
乍一看标题还以为面试亚麻三次。
t********e
发帖数: 143
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.
p*****2
发帖数: 21240
15
对了。第二个hashtable应该用个BST吧?
l*****a
发帖数: 14598
16
我祝你实现1成概率

【在 g*********e 的大作中提到】
:
: 9成去。

l*****a
发帖数: 14598
17
感觉上你不像是在用数据结构
像是在用数据库

【在 t********e 的大作中提到】
: 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.

a********d
发帖数: 195
18
能麻烦说说两个table的key和value分别是什么么?谢谢。

【在 E******t 的大作中提到】
: 原题是这样的
: 给你一个大log 文件,只有两个列,user id 和page number举一个简单的例子:
: User ID Page #
: A 1
: A 2
: A 3
: B 2
: B 3
: C 2
: B 4

w*******l
发帖数: 33
1 (共1页)
进入JobHunting版参与讨论
相关主题
L家 index设计题Amazon面经
Got an offeramazon版上面试问题请教
突然想到一个关于string matching的题问两道amazon的面试题
一道面试题:比较hash table和BSTamazon三连击这题要怎么设计hash function呢?
亚麻面经universal hashing的问题
三连击rebuild a tree from inorder and level order
STL doesn't have hash Table?Amazon 电面
弱弱的问问跟hash有关的问题A公司面挂了,发面经,攒RP
相关话题的讨论汇总
话题: user话题: page话题: table话题: hash话题: ids