boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Amazon Interview Question
相关主题
Amazon(6)
finds all repeated substrings in the string --- YAHOO interview question
suffix tree 和 trie
on-site的时候Trie和suffix tree会考coding吗?
问个Longest Common Substring的问题
word search follow up的问题
那个 google hint words 的老题
是不是只要是search都是inverted index?
问个算法题7
VMWARE 的在线测试题一个
相关话题的讨论汇总
话题: question话题: amazon话题: interview话题: frequent话题: websites
进入JobHunting版参与讨论
1 (共1页)
m*****f
发帖数: 1243
1
Given a log file, which contains a series of websites, which the user has
visited, find the most frequent path of 3 websites.
e.g: If this is a log file
A B C D E
A C D B E
C D E B A
A C D E B
C D E A B
clearly, C D E in the most frequent website?
Idea?
r**u
发帖数: 1567
2
suffix tree 应该可以干这事吧。每一行是一个string,找所有suffix,放suffix
tree,tree node要记录出现次数,出现次数最多的就是结果。

【在 m*****f 的大作中提到】
: Given a log file, which contains a series of websites, which the user has
: visited, find the most frequent path of 3 websites.
: e.g: If this is a log file
: A B C D E
: A C D B E
: C D E B A
: A C D E B
: C D E A B
: clearly, C D E in the most frequent website?
: Idea?

r*****t
发帖数: 712
3
could you please elaborate on this?

【在 r**u 的大作中提到】
: suffix tree 应该可以干这事吧。每一行是一个string,找所有suffix,放suffix
: tree,tree node要记录出现次数,出现次数最多的就是结果。

c*****o
发帖数: 178
4
请问这里面允许出现重复的网页吗?比如ABCDA这样的?
还有路径必须是连续的吗?如果是连续的,那就是找到所有的长度为3的substring,放
入hashing表,看哪个substring
出现的次数最多就好了
g*******y
发帖数: 1930
5
呵呵,这题前几天才刚刚问过的啊,看来很hot~
hash 和 trie 都能做吧

【在 m*****f 的大作中提到】
: Given a log file, which contains a series of websites, which the user has
: visited, find the most frequent path of 3 websites.
: e.g: If this is a log file
: A B C D E
: A C D B E
: C D E B A
: A C D E B
: C D E A B
: clearly, C D E in the most frequent website?
: Idea?

k***e
发帖数: 556
6
why trie? cannot see any advantage of trie over hash

【在 g*******y 的大作中提到】
: 呵呵,这题前几天才刚刚问过的啊,看来很hot~
: hash 和 trie 都能做吧

H*M
发帖数: 1268
7
题目好像不同啊
这个三个网站不用连续的
还是楼主笔误?

【在 g*******y 的大作中提到】
: 呵呵,这题前几天才刚刚问过的啊,看来很hot~
: hash 和 trie 都能做吧

g*******y
发帖数: 1930
8
呵呵,给面试官表现出你这两个都知道,还可以跟他继续讨论一下hash和trie。

【在 k***e 的大作中提到】
: why trie? cannot see any advantage of trie over hash
g*******y
发帖数: 1930
9
我感觉是同一个题,你看楼主的例子。而且题目里面的词用的是path嘛,应该就是连续的

【在 H*M 的大作中提到】
: 题目好像不同啊
: 这个三个网站不用连续的
: 还是楼主笔误?

H*M
发帖数: 1268
10
我感觉也是
可是你看他第二行是ACDBE啊,CDE没有连续

续的

【在 g*******y 的大作中提到】
: 我感觉是同一个题,你看楼主的例子。而且题目里面的词用的是path嘛,应该就是连续的
相关主题
on-site的时候Trie和suffix tree会考coding吗?
问个Longest Common Substring的问题
word search follow up的问题
那个 google hint words 的老题
进入JobHunting版参与讨论
m*****f
发帖数: 1243
11
should be 连续 ba, may be careercup question wrong.

【在 H*M 的大作中提到】
: 我感觉也是
: 可是你看他第二行是ACDBE啊,CDE没有连续
:
: 续的

H*M
发帖数: 1268
12
mudhoof你的avatar好hot啊

【在 m*****f 的大作中提到】
: should be 连续 ba, may be careercup question wrong.
m*****f
发帖数: 1243
13
配合你的不错啊

【在 H*M 的大作中提到】
: mudhoof你的avatar好hot啊
H*M
发帖数: 1268
14
我的也hot吗

【在 m*****f 的大作中提到】
: 配合你的不错啊
r*****t
发帖数: 712
15
如果是不连续的,怎么解?

【在 m*****f 的大作中提到】
: should be 连续 ba, may be careercup question wrong.
1 (共1页)
进入JobHunting版参与讨论
相关主题
VMWARE 的在线测试题一个
电面不好,求bless。这题怎么答?
一道老题但是以前的解好象都不对
攒rp整理面试题(1)string match/text search
贴一下我google第一轮店面的题目
有没有遇到让当场写一个suffix tree或者automaton的?
急问,Boggle (crossword)的解题思路?
请教suffix array的问题
电话号码是什么data type
MS SDET面经
相关话题的讨论汇总
话题: question话题: amazon话题: interview话题: frequent话题: websites