由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - rejected by facebook after 2nd phone interview
相关主题
求问关于AMAZON SDE I 的准备经验。现在出发去F onsite
攒人品,google电话面经请教:boggle puzzle找所有的单词,怎么做?
一道MS题自己总结了下什么时候用dp(循环),什么时候用递归
新鲜onsite面经求牛人指点a家面试题
急问,Boggle (crossword)的解题思路?A家onsite, OO答的真郁闷
问一道少见的微软面试题。Leetcode Word Break I 有o(n^2)的算法吗?
fb电话面试这个九章算法培训有人用过吗?
问个算法题面试遇到老印,这算被黑了吗?
相关话题的讨论汇总
话题: int话题: trie话题: grid话题: print话题: numbers
进入JobHunting版参与讨论
1 (共1页)
f****e
发帖数: 30
1
第一次:given two integer numbers n and k, print all combinations of k
numbers out of 1 ... n
e.g. if k = 2, n = 4, print
1 2
1 3
1 4
2 3
2 4
3 4
第二次:
if you have a grid
a b c e
d f a h
i j k l
and a dictionary with more than 10K words
print out all words in dictionary that can be obtained by visiting grid.
restriction: if a word is c1, c2, ..., cn, then c_(i+1) should be one of the
eight neighbors of c_i in the grid
第二题出了递归还有什么办法? 我写了一个递归程序,对方问我可以有什么
improvement,想了半天没想出来。
S******A
发帖数: 1002
2
2 is boggle problem
load dic as trie to stop searching immediately upon a dead-end, i guess you
also need to avoid re-using any cell (char) more than once when constructing
a valid word
f****e
发帖数: 30
3
I mentioned trie and that guy asked me to implement it. I said I can not
implement it in just 10 min.
Yes, the problem requires that no char can be used more than once when
constructing a valid word.

you
constructing

【在 S******A 的大作中提到】
: 2 is boggle problem
: load dic as trie to stop searching immediately upon a dead-end, i guess you
: also need to avoid re-using any cell (char) more than once when constructing
: a valid word

W***i
发帖数: 9134
4
"k numbers out of 1 ... n" 啥意思?
H*M
发帖数: 1268
5
select k numbers out of 1,2,...n

【在 W***i 的大作中提到】
: "k numbers out of 1 ... n" 啥意思?
B*****t
发帖数: 335
6
my code for first problem, not tested.
const int N = 1000;
int b[N], a[N];
int n;
void dfs(int a[], int cur, int level) {
if(level==k) {
copy(b, b+k, ostream(cout," "));
cout< return;
}
int i, j;
for(i=cur+1; i<=n; i++) {
b[level+1] = a[i];
dfs(a, i, level+1);
}
}
B*****t
发帖数: 335
7
for the 2nd problem, recursion is not efficient.
Trie or AC-Automation is the only choice! Do 8 direction search on them and
need lots of optimizations and some tricks I think.

【在 f****e 的大作中提到】
: 第一次:given two integer numbers n and k, print all combinations of k
: numbers out of 1 ... n
: e.g. if k = 2, n = 4, print
: 1 2
: 1 3
: 1 4
: 2 3
: 2 4
: 3 4
: 第二次:

B*****t
发帖数: 335
8
May I ask how could you get the phone interview?
thanks.

【在 f****e 的大作中提到】
: 第一次:given two integer numbers n and k, print all combinations of k
: numbers out of 1 ... n
: e.g. if k = 2, n = 4, print
: 1 2
: 1 3
: 1 4
: 2 3
: 2 4
: 3 4
: 第二次:

f****e
发帖数: 30
9
internal referral. 申的是research scientist,按照SDE的标准面试

【在 B*****t 的大作中提到】
: May I ask how could you get the phone interview?
: thanks.

B*****t
发帖数: 335
10
Thanks! and bless you for the future interviews.

【在 f****e 的大作中提到】
: internal referral. 申的是research scientist,按照SDE的标准面试
f**r
发帖数: 865
11
For the second question, the problem space does not seem to be polynomial.
Maximum of n^2 nodes in the search path, at each step >>1 choices on average
, even after taking "visited" flag into consideration. Are the interviewer
looking for a solution that's not exponential?
k***g
发帖数: 75
12
第二个我觉得recursive没啥问题,recursive和trie也没啥矛盾,recursive的过程就
是建trie的过程,如果发现字典里没有,也就结束了。recursive相当于是DFS,也可以
用BFS。

【在 f****e 的大作中提到】
: 第一次:given two integer numbers n and k, print all combinations of k
: numbers out of 1 ... n
: e.g. if k = 2, n = 4, print
: 1 2
: 1 3
: 1 4
: 2 3
: 2 4
: 3 4
: 第二次:

k***g
发帖数: 75
13
你的面试题比我难多了啊,我面的他们的基础设施组,问的问题都好简单。总共四个编
程题,atoi,不用sqrt库函数求sqrt,strstr,反转单链表。

【在 f****e 的大作中提到】
: internal referral. 申的是research scientist,按照SDE的标准面试
h****h
发帖数: 75
14
我也被面到了第二个问题。我给的就是recursive function with backtracking and
also walking in trie tree.
我到没有被要求实现trie tree, 但是说明了在recursive function的那些地方检查
trie tree。

【在 f****e 的大作中提到】
: 第一次:given two integer numbers n and k, print all combinations of k
: numbers out of 1 ... n
: e.g. if k = 2, n = 4, print
: 1 2
: 1 3
: 1 4
: 2 3
: 2 4
: 3 4
: 第二次:

1 (共1页)
进入JobHunting版参与讨论
相关主题
面试遇到老印,这算被黑了吗?急问,Boggle (crossword)的解题思路?
面试问题请教:如何在字典中得到最长的复合词问一道少见的微软面试题。
字典里面如何快速找到一个单词对应的只有一个字母不同的单词fb电话面试
G家电面面经--佛云了~~问个算法题
求问关于AMAZON SDE I 的准备经验。现在出发去F onsite
攒人品,google电话面经请教:boggle puzzle找所有的单词,怎么做?
一道MS题自己总结了下什么时候用dp(循环),什么时候用递归
新鲜onsite面经求牛人指点a家面试题
相关话题的讨论汇总
话题: int话题: trie话题: grid话题: print话题: numbers