#F面经#Facebook

来源:互联网 发布:js获取当前时间毫秒数 编辑:程序博客网 时间:2024/05/16 19:14

把看到的FB面经集中整理到一个帖子里来吧, 随看随搬。

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

【 以下文字转载自 JobHunting 讨论区 】
发信人: gkcja (gkcja), 信区: JobHunting
标  题: 发个f家面经,攒rp
发信站: BBS 未名空间站 (Fri Oct 24 18:55:56 2014, 美东)

八月的时候面的fb,电面和onsite都是local的,发个面经给版上备战的xdjm参考,求
攒rp

电面:

先聊了聊自己的经历,为什么要来fb之类的问题,因为我有图像处理的背景,就问了一
题相关的。
给一个2D board,上面由 0 和 1 组成,0 背景,1是图像,求里面有多少个连通域, 
follow up 是每个连通域的面积是多大。我先写了recursive的做法。后来面试官又要
求了iterative的做法

面完一小时之内,recruiter发邮件说电面过了,可以安排onsite

onsite:

第一轮:主要谈自己以前做的东西,面试官问得比较细,总之就扯了扯。问了一题
coding,给一个数组,问里面有没有两个数相加等于0,给了 O(n) time O(n) space的
做法,和 O(nlog n ) time和 O(1)space的做法

第二轮:给一个bst,和其中一个节点的value,求在bst中比这个节点大的下一个value
,面试官要求 O(1) space和 O(log N) time的解法。

第三轮: regular expression match, leetcode上原题,先写了 dp 的解法,面试官要
求我再写一下recursion的解法,写完后问了两个算法各自的复杂度

第四轮:design,设计手机系统,可以查看周围的好友,饭店,电影院等等

一星期后recuiter打电话,杯具

个人感觉fb面得题目的确不难,基本都见过,但是每道题基本上都问了很多种解法,问
得比较细,而且一定要bug free,这个比较难做到。面经就大致这样了,大家加油共勉
~

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



【 以下文字转载自 JobHunting 讨论区 】
发信人: echoccxx (echo), 信区: JobHunting
标  题: FLAG面试总结
发信站: BBS 未名空间站 (Sun Jun 22 00:53:37 2014, 美东)

因为之前发过贴,背景就不赘述了,具体说说怎么准备还有面经吧。

骑驴找马,一月底开始刷leetcode,到三月中第一个面试,刷了一遍半吧,明显觉得写
第二遍的时候思路清晰多了,code也比第一遍的简洁。其他的就是每家面试前争对性的
看面经,能看多少是多少,四家只有L面经重复率很高,g家最不能预料题型。后面准备
design的时候都是乱看,一些fb tech talk的视频还有之前有人贴过的fb design的总
结,
但我基础不好,临时抱佛脚感觉也没什么用。面经我就只贴面完有及时记下来的,反正
也给过很多朋友了,就贴上来吧。

已经签了fb,准备八月初start,有同一期的pm我,哈。

脸书:

1.  Print all paths of a binary tree
I gave a recursive solution.

Then he wanted to give an iterative way.

2a. Fibonacci (iterative)

2b. Buckets of anagrams
[“cart”,”tarc”, “cat”, “act”, “ract”] -> [[“cart”, “tarc”, “
ract”], [“cat”, “act”]]

onsite design是tiny url, 估计interviewer也知道我没什么经验,问了个最简单的也
没答好。T-T
coding都比较easy。

领英:

1.  Return if two strings are isomorphic. (character 1-1 match)
“zoo” -> “fee”  ( z->f, o->e)               true
“zoo” -> “dui”  ( z->d, o->u, o-> )        false
“dui” -> “zoo” (d->z, u->o, i-> )         false

Use two hashmaps

*****************************************************************
2.  K nearest points (solution see below)  Time: O(nlgk)

*****************************************************************
1.  Search in rotated sorted array

*****************************************************************
2. public interface Intervals {

    /**
     * Adds an interval [from, to] into internal structure.
     */
    void addInterval(int from, int to);


    /**
     * Returns a total length covered by intervals.
     * If several intervals intersect, intersection should be counted only 
once.
     * Example:
     *
     * addInterval(3, 6)
     * addInterval(8, 9)
     * addInterval(1, 5)
     *
     * getTotalCoveredLength() -> 6
     * i.e. [1,5] and [3,6] intersect and give a total covered interval [1,6]
     * [1,6] and [8,9] don't intersect so total covered length is a sum for 
both intervals, that is 6.
     *
     * 0  1    2    3    4    5   6   7    8    9    10
     */
    int getTotalCoveredLength();
}

亚麻:

1a. Given 2 sorted, singly-linked lists, write a function that will merge 
them into a new sorted, singly-linked list

Ex.
1->2->4->8->16->32
2->4->6

1->2->2->4->4->6->8->16->32

*****************************************************************
1b. merge n sorted lists 
//   1 -> 3,
//   2 -> 5
//   4 

newhead: 1 -> 2 -> 3  -> 4 -> 5

*****************************************************************
1c. Given a Binary tree, print path from root to all nodes that are 
divisible by 5

Input:
    6
   / 
  5   7
     /   
    4    15
   /      | 
  3  10  2  8

Output:
6 5 
6 7 4 10
6 7 15

*****************************************************************
2. Given an array A (the array can be treated as a big number) and a number 
n, find the biggest number that you can reach to via n swaps. A swap can 
only happen in adjacent items. For example, given [1 3 4 2 5 7 9] and n = 1,
the biggest number is [3 1 4 2 5 7 9]

n=1, 3 1 4 2 5 7 9

n=2, 1 3 4 -> 1 4 3 -> 4  1 3

狗家:

1.  Reorder List (leetcode)

1->2->3->4->5   =>  1->5->2->4->3

*****************************************************************
2.  Abbreviation: apple can be abbreviated to 5, a4, 4e, a3e, …
    Given a target string (internationalization), and a set of strings, 
return the minimal length of abbreviation of this target string so that it 
won’t conflict with abbrs of the strings in the set. 

“apple”, [“blade”] -> a4 (5 is conflicted with “blade”)
“apple”, [“plain”, “amber”, “blade”]  ->  ???

Problem changed to:
If given a string and an abbreviation, return if the string matches abbr.

“internationalization”, “i5a11o1” -> true

*****************************************************************
Onsite:

1a. Write a function to get a positive integer n as input and return 0 or 1.
The probability of returning 1 should be 1/(2^n)

1b. Given an array, return the median. (talk about expected time complexity)


2a. Code review - a class which takes a string, split by separators and 
return the array of tokens (point out coding problems and indicate how you 
will implement it)

2b. Longest consecutive sequence (leetcode) (how do you handle duplicates)

2c. design: how to store files given the file paths and contents. (tree?) 

3a. Given an array and a number x, find out how many pairs satisfy (a[i], a[
j]) st. a[i]+a[j] < x

3b. follow up: if we want to find 3 items that adds up to a number < x

3c follow up: if we want to find k items. Time complexity: O(n^(k-1)*lgn)


4. Give a map which has some obstacles in it. Given a starting point S and 
ending point E, find the shortest path from S to E. Note that you can go to 
any(4) direction from S, but during the process, you can only go straight 
from the previous direction, unless you hit an obstacle.
i.e. if you are at (1, 1) and the next (1, 2) is blocked, you can only go to
(2, 1) or (0, 1)  


5a. Java “final” keyword

5b. 3-way partition: given an array and number x, reorder the array so that 
first part will be < x, middle part is = x, and final part is > x. 

5c. Design: given an array of integers and a range (i, j), we want to return
the min item in the range (balanced binary search tree)

5d. System design: given a machine, how to generate id so that they will not
duplicate; if we have multiple machines, what to do


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


【 以下文字转载自 JobHunting 讨论区 】
发信人: milili (milili), 信区: JobHunting
标  题: Google, Facebook, Rocket Fuel面经及经验总结
发信站: BBS 未名空间站 (Sat Sep 28 18:53:20 2013, 美东)

找工作期间在本版潜水两个月,收益良多,发一下最近面经和经验作为回馈。
本人背景:美国不错学校电子PHD即将毕业,专业是EDA做电路设计算法优化。因为EDA
已经是一个很稳定的工业,没什么太大的前景,随想转到前沿的tech公司。本专业只投
了一家现在最大的公司,拿到offer。别的投了Google, Facebook, Rocket fuel, 
Twitter, Linkedin, Yahoo, Amazon, Box, Oracle. 除了box别的都找人refer了, 在
此感谢板上大哥们的热情帮忙. 除了GFR别的都没理我,可能背景差太大了。

因为之前是学算法的,mit算法书以前就看过两遍,基础还可以,前期8月份刷了遍
leetcode。然后9月初投出简历。两个星期刷Career cup 150, 最后面试期间一直查缺
补漏。到现在尘埃落定大概两个月。 最后GFR全挂,总结下惨痛经历:

1. Facebook电面

面试官做distributed cache infrastructure的,先问我最难的project,没怎么好好
准备过behavior,胡乱说了一通。但是因为做的是电路相关,非行内人士很难明白,讲
的也比较乱。最后估计起到了反效果。感觉如果不是有特别好的经历和体会的话(特别
对于fresh在校内没什么好相关项目经历的)这种最好长话短说想办法一笔带过,不然
可能起到反效果。

浪费了大几分钟开始第一题,leetcode原题,Valid Panlindrome
"A man, a plan, a canal: Panama" is a palindrome.

这题之前做过,也很简单,但当时太紧张出了一个很sb的bug,还是在面试官提示下找
到的。15行的代码出bug实在是不能犯的错误。另外在判断一个char是否letter的时候
没有另用函数把一堆&&写了两次,被批评不够简洁。

第二题,将1->2->3->4->5->6->7 变成 1->7->2->6->3->5->4,不能用额外空间

第一遍用了recursive很快解决,被指出用了stack额外空间,开始改iterative,最后
因为第一题浪费时间手忙脚乱没改完。说了一下大概思路草草收场,面完就知道不妙。
4天后被通知挂了。

总结: facebook非常重视coding的clean和bugfree。 这两题都没什么算法但是如果
coding不过硬第一遍很容易有bug,我感觉从这点上来讲面试官出题水品很高,死的心
服口服。 另外他家感觉比较看背景,phd onsite会有jedi面试问项目经验什么的,专
业差太大估计要超级牛才容易过。

2. Google电面

上来直接上题,题目有些绕。CSS里面表示颜色用
#abcdef (eg 0x1F2A3B) 这种形式, 每个字母代表四个bit (hex),两个字母代表一种
原色
比如 ab = R, cd = G, ef = B (每种原色整个是0-255间的一个数字)
现在需要压缩空间改#abcdef 为 #xyz
实际上#xyz = #xxyyzz,所以减小一半,问怎么找到最好的压缩让
(ab-xx)^2 + (cd - yy)^2 + (ef - zz)^2 最小

这题其实数学上很简单因为三个维度是分开的,其实就是找#ab到#xx的压缩。

我当时的面试官是个asian可能是韩国人或abc,有点bitchy。我最开始说让我想一想,
才过了5秒钟他说不知道我在想什么让我在google doc上打,然后我就在上面打example
试图观察一下规律,他又阻止我说不用什么都打出来。完了我说了我的观察: a的权重
更大, x应该很接近a, 实际上 x = a, a - 1 , or a + 1。 然后他不置可否。可能
我说的不是很清楚,他又开始和我纠结我的变量名用得不好。因为他一直和我纠结这些
细节,我也没法安心思考,直接就开始写code,又拿不准函数input和output应该用什
么样的type和形式。这就是这种模糊提很麻烦的一个地方。面试官还是不给提示,我就
开始写但是code写的很乱。中途面试官没有任何提示。完了我说想move on到下一题他
说没时间了要我找bug。整个code写的很糟,因为没有分情况按 a > b 时 x = a, a- 1
, a < b时 x = a, a + 1这样来考虑所以变成了for loop非常乱。还剩5分钟时万念俱
灰面试官问我还可以怎么optimize已经没心思回答了跟他说”如果你想让我检查代码我
就看吧“开始有点顶撞他的意思。我电面这么多次第一次和面试官搞得这么僵心情非常
沮丧。最后草草收尾。3天后通知被挂。

心得体会:google电面其实是很松的,很容易过。电面没过打击很大,除了运气不好碰
到面试经验不丰富的面试官和模糊题外主要问题还在自己。因为题目并不难,就算和面
试官不和拍也应该避免干扰仔细思考认真写代码。特别是到后面十分钟我有点破罐子破
摔,这样给面试官映像肯定非常糟糕。因为面试的一个目的就是考验你是rise against
challenge还是crash under pressure。这点上我表现的非常失败。因为google家比较
看中算法算是我的强项,所以没能去成onsite非常可惜。

3. Rocket Fuel

网上交简历,当天收到hr回信,过两天和hr电话chat半个小时,主要问问背景和看你是
不是serious applicant。完了发来online test 5hour。我做的auto racer。没有
follow他的hints选了最优算法但是由于编不出balanced avl tree有个test case没过
,还是个给了电面,面试官是三哥,电面是之前有人贴过的ad query题,给出了大家讨
论的最优答案,又拓展到分布式系统。才说了半个小时面试官突然说时间到了问我有没
什么问题,我看他很急就说没问题就bye了。本来以为肯定挂了因为预定要一个小时,
结果过了两天recruiter说feedback very positive让我去onsite有点莫名其妙。

onsite中午和一个cmu毕业的topcoder 2000+的nb phd吃饭闲聊了一下,下午面了四个
人,三个三哥一个asian。两个big data infrastucture(最后端)的, 两个serving 
infrastrucre(中后端)的。所有题目在之前rocket fuel的帖子里或者leetcode都能
找到,除了一道挺有意思的题

给定一个n*n的board里面是0或1.算出里面独立0group的数量。比如

0 0 1 1 1
0 1 1 1 0
1 1 1 1 0
1 0 1 1 1
1 1 1 1 1

答案是3个group。我瞬间给出了一个BFS的O(n^2)答案,被指出需要visited数组的额外
空间。然后给了一个逐行扫描的算法相当tricky,我经过提示才想出来。面试完后第二
天被告知挂了。其实自我感觉还不错除了java multithreading答的不好。recruiter给
的反馈是总体还不错但有人指出我coding a bit messy。说另外还有一个不错的
candidate选了另外那个人,说我是pretty close。我自己猜测如果不是因为另外一个
人是三哥或美国人这种原因还是死在coding quality上,另外背景实在差的有点远。他
家要求最好一遍写出clean code。另外在onsite是建议code不要写太长,如果要超过一
黑板最好把里面主要部件都先用函数代替写出主要流程向面试官说明之后补充即可。

心得: onsite时因为很多题都见过经常迅速讲一下思路就开始coding,感觉交流不够
。面试的时候交流还是第一位的,如果跑上来就写代码写的再好面试官对你印象也未必
好(可能还会觉得你是练过的),因为他会把你当成未来的coworker所以交流的融洽是
很重要的。rf家的big data infrastructure全部是三哥,我觉得这也是我挂的一个原
因,建议申请ai optimization那些核心组,那才是他们家的精髓所在。rf没有之前提
的那些帖子那么乱但感觉还是不够正规,面试的时候不是很舒服,连schedule都不给你
,说好的面试官经常换人。

总体心得:coding不过硬会导致必然的失败。我之前就是觉得自己算法底子不错忽视了
coding,其实本末倒置。工作中coding才是最重要的,而且看了很多牛人的coding之后
才发现这个事情真的不是搬砖那么简单,同一个内容的程序coding好不好能差很多(再
加上clear和readability的考虑)。顶尖it公司要的不是average coder而是top coder
,所以以前仗着算法不错就满足于average的coding水品实在是很幼稚,以后一定会在
这方面加强锻炼。

个人还有些算法和advanced data structure的重点觉得没有在leetcode里面很好体现
的,总结如下:

1. 很多recursive容易的算法也要考虑iterative方法。因为掌握iterative代表你对问
题结构理解上升了一个高度。e.g. reverse linked list, tree traversal

2. i) top k (kth) elements: heap O(n+klogn), quickselect O(n) average O(n^2)
worst, median of medians O(n) worst. cons and pros.
Extension: what if all data can not fit into memory. heap size of k O(nlogk)
for single machine, many machines see 3.
ii) get median in data stream: max heap + min heap

3. kth element in many m machines: binary search, pick a pivot and see how 
many less and larger among all machines, then discard halves accordingly (
distributed quickselect)

if sorted in single machine: find smallest (k/m)th element among all 
machines and discard the less partition.

4. stack support O(1) getMin
   queue support O(1) getMin
e.g. k sliding window, most frequently clicked url in past 12 months.

5. reservoir sampling for infinite stream, generate random(1-7) with random(
1-5), card shuffle, string permute in place

6. data structure with O(1) insert, delete, getRandom, get: hashmap + array

LRU data structure: hashmap + doublelikedlist.

binary search tree with rank() (position of inserted or queried data)
(add treesize attribute for each node)

7. bit operation and bitset.
e.g. find missing number in large data, reverse binary number, 

8. java multi-threading, blocking queue, nonblocking queue, H20, philosophy 
dining, deadlock checking. 现在是个公司都问concurrency,一定要好好准备。

9. OOP: elevator design, parking lot design
distributed: large log file design, social network design, distributed cache
design ....

本人已挂等待明年满血复活,祝各位job hunting顺利。


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

第二轮经典celebrity题,stack做,O(n):
http://www.fgdsb.com/2015/01/03/the-celebrity-problem/
. 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
第三轮就是exclusive product:
http://www.fgdsb.com/2015/01/13/get-prod-array-without-div/

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

http://www.mitbbs.com/article_t/JobHunting/32922669.html

第一题是print all path from root to leaf
比如tree是
                A
            B       C

print AB, AC

这题用DFS还蛮好做的,如果用stack怎么做呢?


第二题有点像,给一个tree,返回每个点左右子树的和与自己值的差,用递归做,还问
了不递归怎么做

这题也是dfs好做,如果不递归的难点在于,每个treenode需要记录他的左子树的和,
右子书的和,再减去自己的node val. 一个stack好像不够,我是用了一个hashmap记录
每个node对应的左右子树的和,再用一个stack做post order traversal, 感觉挺麻烦
的,不知有什么巧妙的办法吗?


谢谢大家帮忙!

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


标  题: 面完fb,结果已经出来了,share下被拒的原因(请转jobhunting版 (转载)
发信站: BBS 未名空间站 (Wed Nov 19 21:05:36 2014, 美东)

发信人: Dreamer (不要问我从哪里来), 信区: Dreamer
标  题: 面完fb,结果已经出来了,share下被拒的原因(请转jobhunting版
发信站: BBS 未名空间站 (Tue Nov 18 20:46:44 2014, 美东)

考了下古,发现这位哥们的转贴,基本可以确认是一个人,基本可以确定这个是我被拒
的原因

同样迟到了大概5分钟,闲扯了十分钟左右,然后read4,确实很简单,但是给的题目非
常不清楚,所以完全没有考虑buffer里面留下的部分,中间我问了除了输出int,需不需
要考虑读出的字符放在哪里,被他含混过去了。自己没做过底层的东西,竟然也没有看
到这个帖子,细节基本一致,因为题目很简单,所以35分钟内完成,全程毫无任何提示
,所有问他的问题基本上都回答得非常模糊,非常有误导性。之后让问fb问题,自己回
答了六周的ramp 什么着,我明明没问。。。最后拍照

我比下面这位哥们唯一好点的地方,我记下了这个人的名字的大致发音,自己查了下
linkedin, 应该是R--it---u---raj Kir---ti 

希望以后面fb的诸位,千万小心入口buff需要变动位置,函数外创建类,类里头存上次
buff读入的byte数,然后做移动。

顺便求个bless面l和g的时候别再碰到烙印
===============================================

发信人: will5 (绽放), 信区: JobHunting
标  题: FB临门一脚挂了,那种郁闷悔恨的感觉.
发信站: BBS 未名空间站 (Thu Oct 17 17:55:34 2013, 美东)

上次onsite,4轮,自己感觉很好.
HR回信也说: went well so far but still need last code question interview to 
end the process
要安排电话面试
结果我说:电面不好,我要求onsite,今天上午就onsite了.

结果, 一看是一个严肃的老印,基本听不懂其在说什么
就一道题:
实现 int Read(int Size, char * buffer) using int Read4(char * buffer)
这题思路很简单的,我当时给了2种方法结果在他的引导上走上了一条不归路,第一次实
现有bug, 没考虑buffer里面留下的部分....汗 ...各种改...(这题原来有过类似的 
readLine, 但是自己觉得应该简单没有动手仔细写过, 结果在press下不能写好, 还是
实力不够!!!)
最后老印拍了照,明显要回去Negative的节奏

也许看到了老印,第一感觉就不妙吧,有了心理暗示, 过程中沟通也不是很顺畅. 面到40
分钟的时候,老印就不出题了, 直接叫问问题.汗

郁闷, 悔恨, 临门一脚, 我是中国足球队吗, 对自己的能力深深的怀疑!!!

再补充几个细节:
1) 此老印说之前在很多公司做过 现在在做Ads这一块. 前面闲扯的时间差不多有78分
钟, 本身他出来接我的时候也迟到了几分钟
2) 在35分钟左右的时候,他就说你问我问题吧, 你就问问我fb的process吧? 我汗, 我
说好的,那你介绍介绍吧, 无非就是6 weeks的ramp up什么的,这些我都知道了,明显是
拖时间到点. 
3) 他送我出去的时候,还说:今天只面我一个吗? 我去, 你都送我出来了, 还这样问
4) 全程毫无提示

虽然不能归结为被黑了,但是和之前的 3个老美(或者欧洲) 一个台湾GG 的风格完全不
同, 这四轮过程非常愉快.

也许有人会问, 既然那四轮很好,为什么要加面一轮, 原因在这里:
1. 我没有经过电面,直接onsite的,也许会被认为缺一些coding的考察吧
2.上次四轮, 最后一轮, 第一个问题是: N个平面上点,找离原点最近的K个, 我本来要
给三种方法: 1. N*Log(K) 2.KLog(N) 3.select K 结果说了第一种之后,看他反应不错
,我就问写code吗?他说ok,然后就写完了用priority queue. 当时脑袋蒙了想起select 
K的最优解决是 5中取1(不是一般快排的取pivot的方法), 我没信心完全写出code, 就
没说select K的算法.事实上用quicksort写也是很容易的.
至少用priority_queue 写完之后没bug, 后来又写 shift sorted array做binary 
search, 写的太快了给人是背答案的感觉,也没bug. 第三个题是实现Heap(其实就是他
对前面的priority_queue有疑问,他说他对priority_queue不熟悉)push pop top, 实现
了最后支出一个小bug,fix


所以我觉得第四轮有一些疑惑再加上没有电面, 加面一轮到是可以理解. 

生活没有假设, 也许上次onsite最后一轮直接给最优而不是走了保守策略, 可能也ok了
, 也许这轮onsite像原来希望的交流很smooth(这也是我没有选择telephone interview
的原因)话也会ok的, 也许遇到了困难我能很calm down的去解决问题, 最后结果也可能
不错.
Anyway, 只能move on了, 也祝愿后来的面试的人能多点运气,能一气呵成, 拿到offer!

Bless大家!


===============================================

http://www.mitbbs.com/article_t/JobHunting/32832867.html

首先感谢帮我内推的哥们,谢谢你让我顺利拿到电话面试。
其他的就不废话了,电话打进来了。一哥们先介绍了一下他做的东西,做API的。然后
说了2min,给我说今天一共45分钟,首先会问5-10分钟简历,然后30分钟左右的coding
,最后的时间提问。
1. 一来就是一道简单题,翻转链表
// Reverse a Singly Linked List
// Example Input: A -> B -> C
// Example Output: C -> B -> A
他先让说思路,然后问时间和空间复杂度,然后写代码。说思路说了半天,这种list的
题,就是画图,英语不好说起来真费劲。。。这道题应该是Leetcode上一道的一个小部
分,所以很快就写完了。

2.第二题直接copy 题目,感觉跟leetcode上面的interval那题很相似,简单一点点。
// Given a array of pairs where each pair contains the start and end time of
a meeting (as in int),
// Determine if a single person can attend all the meetings
// Input array(pair(1,4), pair(4, 5), pair(3,4), pair(2,3))
// Output: False

同样的思路+复杂度。 同样是变种题,还变简单了,很快写完。(主要是考比较器的
override吧)

3. follow up第二题
// determine the minimum number of meeting rooms needed to hold all the 
meetings.
// Input array(pair(1, 4), pair(2,3), pair(3,4), pair(4,5))
// Output: 2

我看表还剩下10分钟,然后想了3min钟,面试官就说没时间了,要不你说说思路。然后
说了一下思路,面试官说OK。让我提问题。瞎问了一个问题。面试官还特别详细的解答
了。他说超了一点时,不过没关系。 然后互相感谢了一下,客套了一下。就再见了。 
第二天HR说下一轮Onsite了。 

最后求大家祝福,希望能onsite好运~~ 祝大家都能拿到心仪的offer~

0 0
原创粉丝点击