版上看了些面经,至少把airbnb的电话面试题都给看到了,虽然最后把airbnb的onsite
推掉了,但电面直接碰上原题的感觉真的好tmd有成就感。最后回馈一下版面。
整体感觉,国人面试官真的都非常的nice,老外大部分也都很nice,甚至碰到的三哥三
妹都很nice,没有感觉恶的。个人感觉面试的时候还是要多说话,不要让面试官说话,
更加不要让面试冷场,这个还是挺重要的,否则面试官一尴尬,直接就觉得没有
chemistry,反馈不可能很好。
我自己由于刷题刷得太烂,根本不想刷,看着就烦,只是把ccr和leetcode答案给看了
几遍,一遍都没写过,别的网站看都没看。所以可能不适用刷题刷的nb的同志们。基本
每家公司每道题都有时间复杂度分析,建议注意。
airbnb电面两轮,一个是house robber,一个是csv parser。
fb电面也是两轮,一个maximum continuous sum for an array, career cup面经原题
,一个是简单的trie,还有一个是n个元素中求包含k个元素的组合,dfs做,follow up
提高performance,被国人大哥挂掉了(不怪他,怪自己刷题太烂了)
狗家电面:求二叉树的最小深度,国人大哥非常nice!
Netflix onsite:
打印二叉树的每一个节点的深度
实现一个线程安全的读写锁
设计一个咖啡机
还有几道题忘记了
不知道是不是我的特殊情况,狗家题基本没有刷题的题,也没有什么偏题,挺好的,刷
题基本没用。大多面试官都很nice,全程和你聊天,他们面试属于打发时间(20% free
time,所以他们很放松),题都不难,但我个人感觉每个面试官都特别注意和你的交
流,经常还会开个玩笑啥的,说话一定要大声点,个人感觉自己神侃的还不错,每个面
试都是在大笑中结束的。anyway,给我offer我也不会去了,祝好运。狗家的食堂真tmd
好啊。
all question with time complexity questions
1. implement one method register_job(func, args, clocktick) in C (严肃的美
国小哥)
it puts the method func into a job queue, after clocktick time, run this
function with parameter args and remove it from the queue.
Provided API:
current_time() returns the system time
timerfunc() is a hook called by the os for each clocktick.(This function
should be implemented by yourself)
No usage of existing data structure
follow up: register_job and timerfunc both operate on the queue, thread
safety issue.
2. Given time range: (Nice的美国小哥)
class Range
{
int start;
int end;
}
Implement a library, provide three methods, add range, remove range, inside
range;
Range *addrange(int s, int e)
void removerange(Range *range)
bool insiderange(int time);
add or remove can have some freedom on performance, the insiderange method
must be as fast as possible
3. Given a dict vector<string> dict contains all the words (nice的东欧小哥
,听口音)
when user types words on a phone, provide the user with suggestion.
vector<string suggestion(string input, vector<string> dict)
first don't consider performance, questions about how to decide which words
will be shown to user(ranking by popularity maybe)
then performance consideration, two methods.
class trie
{}
void preprocess(dict)
vector<string> suggestion(string input, trie) //just return all suggestions.
implement everything
4. expression calculation (nice的国人大哥)
int calc(char *input)
3-->3
( + 3 3 )-->6
( * 3 2 ( + 1 2 ) 55 )-->3*2*(1+2)*55
only support + and *, each number and operator separated by space. 国人大哥
is a c guy, doesn't know c++ very much, but I did it in c++ anyway.
5.utf-8 validation (nice的国人大哥)
in utf-8, for each byte,
starts with 0 means the character only contains one byte
0XXXXXXX
starts with 110 means the character contains two bytes with following
110xxxxx 10xxxxxx
starts with 1110 means the character contains three bytes with following
1110xxxx 10xxxxxx 10xxxxxx
starts with 11110 means the character contains four bytes with following
11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
......
continue until 7 leading 1s
implement one method
bool judge(string input) to check whether the input is a valid utf-8 string
6. implement a malloc with alignment in c (nice的国人大哥)
void * amalloc(int size, int alignment)
7. design question(三哥)
design a web server system, how you will do it if traffic keeps doubling. (
the webserver and the database system)
No comments:
Post a Comment