than 5000 times)
Google题目:
1. MST of a all connected graph. Need to use Fibo heap to reduce complexity.
2. Game of Life, one transition (sub O(n^2) solution).
3. String compressor that turns 123abkkkkc to 123ab5xkc. Decompressor is already written and must remain unchanged. (messy code)
4. Youtube mash design, how to do a video version of Mark’s FaceMash.
题全都没见过,rej
Facebook题目:
电话
1. Big Integer multiplication. (Optimization required, how to do 8 digits*8 digits, etc).
2. Binary tree level order traversal. (leetcode original)
3. 也是leetcode原题,不记得了
Onsite
1. Given 1->a, 2->b … 26->z. 126 -> az or lf or abf (bfs/dfs not accepted, need to use DP or some tricky method)
2. Binary tree serialization/de-serialization (这道题pinterest也问了)
3. Permutation with duplicate
4. Range maximum query, pre-processing in O(n) and query in O(1)
题答少了一道,rej
LinkedIn题目
电话
1. pow(x,n), check boundaries, O(log(n))
2. rotated binary search (leetcode)
3. hashcode()
of a String in Java
4. Kth closest point to point P on a plane with N points (heap, comparator).
5. ArrayList impl without importing ArrayList, use dynamic array
Onsite
1. IsSameTree (leetcode)
2. Word Ladder II (leetcode)
3. Text Justification (leetcode)
4. how to get top 10 Exceptions for the past 24 hours in 400 machines and update every 5 minutes. General idea: Kafka + Storm. Uses sliding window, hashTable, heap. (这道题pinterest也问了)
5. Tell me in depth about the project you’re most proud of (45 mins).
6. How would you improve LinkedIn Influencer to enter international market. 这道题正中下怀,我口若悬河谈天说地,从GFW到Akamai到蓝汛ChinaCache,从比尔盖茨到李开复,从11年的茉莉花事件LinkedIn主站被墙到如何有效censorship,从网页设计一致性到本土化,和面试官一拍即合,看他当时满面红光我就知道自己有戏啦,果然隔了一天就收到Offer。
其他重要题目和技巧:
2Sum 3Sum, rotate LinkedList, minimum path sum, combinations
注重练习tree的recursion搜索, dp, greedy, two/three pointers, stack. 谷歌的题是很难刷到的,要靠运气,其他很多公司(尤其是亚马逊为首)都可以靠刷题大幅提高胜算。