跟FB同一周面的……今天催L的recruiter,催来了个悲剧……
总共电面2轮,onsite5轮 - 其中2轮coding,2轮resume check和project,1轮design
……算上电面,总共面了11道……题目顺序已打乱:
1. given the list {{1,1},2,{1,1}},返回10……因为,(four 1's at depth 2, one
2 at depth 1). 给定 {1,{4,{6}}} ,返回27……因为, (one 1 at depth 1, one 4
at depth 2, and one 6 at depth 3)
2. leetcode: traversal binary tree level by level
3. 给2个string,判断是否可以map. say (foo, abb) 这2个string是可以map的, f->a
, o->b. say (foo, sdf),是不可以map的……返回bool值
4. 给一个string,每10个letter一组,输出所有出现次数超过一次的strings with
length of 10. 一定要用rolling hashing做
5. 给一个数组,输出连续元素的最大和。
6. 判断2个linkedlist是否在某一点会重合. O(1) space.
7. leetcode: Max Points on a Line
8. string reverse. 输入 "Hello, word", 输出 "word Hello,".
9. 给一个数组,输出连续元素的最大乘积。
10. leetcode: permutations
11. 给一个数组,a(10, 2, 5)……输出一个数组, b(10, 50, 20)……b[i]是除了a[i
]以外剩下a中所有元素的乘积……不准用除法.
L家是有题库的,把版上的面经都看一遍就差不多了……
design是设计amazon product page的后端
非常感谢版上大牛们的帮助……感谢版主done一直以来热心的帮助……感谢dongfeiwww
大牛的内推……感谢2爷的帮助……
准备的话,主要是还是leetcode+版上面经……第一遍的时候刷得挺慢的,后来慢慢好
些……刚开始做的时候可能想的是尽快把所有题目做完……在做第二遍的时候更多的是
想着这题还可以用其他什么方法来做……比如之前用recursive,这次可能用iterative
来做……第三遍的时候,会把做得不熟的题目记下来,然后专门再做几次……我当时给
自己的要求是,onsite之前要达到leetcode随便一道题,在10分钟之内可以写出一次性
提交通过的程序……
EPI是本好书……上面的题目感觉很难……个人感觉超过了FB和L的题目难度……在
leetcode做得滚瓜烂熟了以后,可以做做这本书……
design的话,因为master做的东西跟distributed system相关的,所以感觉面试得时候
还是比较顺的……所以对于还在学校的学生,可以多选些distributed system相关的课
程……感兴趣的话,可以去找做distributed system研究的research lab去做做……
最后,再次感谢版上的大牛们和leetcode……从版上学到了很多东西,希望上面写的这
些也可以帮助到的其他的人……祝大家马上拿OFFER!
z*******y 发帖数: 578
2
赞 顶 祝楼主拿到fb的offer
design
one
4
>a
【在 v***d 的大作中提到】 : 跟FB同一周面的……今天催L的recruiter,催来了个悲剧…… : 总共电面2轮,onsite5轮 - 其中2轮coding,2轮resume check和project,1轮design : ……算上电面,总共面了11道……题目顺序已打乱: : 1. given the list {{1,1},2,{1,1}},返回10……因为,(four 1's at depth 2, one : 2 at depth 1). 给定 {1,{4,{6}}} ,返回27……因为, (one 1 at depth 1, one 4 : at depth 2, and one 6 at depth 3) : 2. leetcode: traversal binary tree level by level : 3. 给2个string,判断是否可以map. say (foo, abb) 这2个string是可以map的, f->a : , o->b. say (foo, sdf),是不可以map的……返回bool值 : 4. 给一个string,每10个letter一组,输出所有出现次数超过一次的strings with
【在 v***d 的大作中提到】 : 跟FB同一周面的……今天催L的recruiter,催来了个悲剧…… : 总共电面2轮,onsite5轮 - 其中2轮coding,2轮resume check和project,1轮design : ……算上电面,总共面了11道……题目顺序已打乱: : 1. given the list {{1,1},2,{1,1}},返回10……因为,(four 1's at depth 2, one : 2 at depth 1). 给定 {1,{4,{6}}} ,返回27……因为, (one 1 at depth 1, one 4 : at depth 2, and one 6 at depth 3) : 2. leetcode: traversal binary tree level by level : 3. 给2个string,判断是否可以map. say (foo, abb) 这2个string是可以map的, f->a : , o->b. say (foo, sdf),是不可以map的……返回bool值 : 4. 给一个string,每10个letter一组,输出所有出现次数超过一次的strings with
根据c++ 64位整数的设定,题目的10位hash编码可以用2^5为底数,包括0-31
可以包括26个字母,这样编码解码代码如下,unsigned long long 是64位
不会越界,但是unsigned long和int相同,不足50位会导致越界,hash代码如下
unsigned long long rollinghash(string s)
{
unsigned long long res=0;
for(int i=0; i < 10; i++)
{
unsigned long long tmp = s[i] - 'a';
if (tmp >= 0 && tmp <= 25)
{
tmp = tmp << (i*5);
res |= tmp;
}
}
return res;
}
【在 v***d 的大作中提到】 : 跟FB同一周面的……今天催L的recruiter,催来了个悲剧…… : 总共电面2轮,onsite5轮 - 其中2轮coding,2轮resume check和project,1轮design : ……算上电面,总共面了11道……题目顺序已打乱: : 1. given the list {{1,1},2,{1,1}},返回10……因为,(four 1's at depth 2, one : 2 at depth 1). 给定 {1,{4,{6}}} ,返回27……因为, (one 1 at depth 1, one 4 : at depth 2, and one 6 at depth 3) : 2. leetcode: traversal binary tree level by level : 3. 给2个string,判断是否可以map. say (foo, abb) 这2个string是可以map的, f->a : , o->b. say (foo, sdf),是不可以map的……返回bool值 : 4. 给一个string,每10个letter一组,输出所有出现次数超过一次的strings with
【在 v***d 的大作中提到】 : 跟FB同一周面的……今天催L的recruiter,催来了个悲剧…… : 总共电面2轮,onsite5轮 - 其中2轮coding,2轮resume check和project,1轮design : ……算上电面,总共面了11道……题目顺序已打乱: : 1. given the list {{1,1},2,{1,1}},返回10……因为,(four 1's at depth 2, one : 2 at depth 1). 给定 {1,{4,{6}}} ,返回27……因为, (one 1 at depth 1, one 4 : at depth 2, and one 6 at depth 3) : 2. leetcode: traversal binary tree level by level : 3. 给2个string,判断是否可以map. say (foo, abb) 这2个string是可以map的, f->a : , o->b. say (foo, sdf),是不可以map的……返回bool值 : 4. 给一个string,每10个letter一组,输出所有出现次数超过一次的strings with
l*****a 发帖数: 14598
13
第一题用什么类型定义参数呢?
List
v***d 发帖数: 42
14
public interface N {
boolean isInteger();
Integer getInteger();
List getList();
}
这是题目给的,不用实现,直接可以用
【在 l*****a 的大作中提到】 : 第一题用什么类型定义参数呢? : List
l********3 发帖数: 33
15
十分感谢!
【在 v***d 的大作中提到】 : assume size of a is n : 用2个数组 : prev[i] = a[0]*a[1]*...*a[i] : back[i] = a[i]*a[i+1]*...*a[n-1] : 结果 : res[i] = prev[i-1] * back[i+1] : 注意处理下边界情况