Facebook 社招挂经

1。 Laoyin. Validate BST. Regex matching。烙印给完题都举好多个例子,有拖延时间的嫌疑。regex那题本人做过但做不到秒杀,烙印非要我解释清楚再写code。最后没写完。自己刷题不够。这轮铁定挂。
2.看名字像法国人。面经题 (a) Given a big dictionary (has ~1Mwords) that has only [A-Z] and a string of characters, named “input”, onlycontains [A-Z]. find all the words that can be formed by the characters in theinput. (b) the input is a list of words. Return a list of lists of words thateach list is formed by exactly the characters in the input list. For example: two lists {“DEBIT”, “CARD”} and{“BAD”, “CREDIT”} are formed by the same exact group of characters. 写(b)的时候出了个bug,让面试官指出来的。

3.国人小姐姐. BQ + first missing positive. LC41. 做题的时候大姐说还有15分钟,给你10分钟做道题吧.当时一下想到怎么做,但这题要写好还挺tricky.这题几年前刷的,现在都忘了。一翻LC,竟然是hard。。。还没写完,大姐说还有5分钟,有什么问题问我。用一个额外的O(n) space 就简单多了,但我当时也没问可以不可以,直接上的inplace。结果没能一气呵成。

4.ABC 男,很nice. System design.当用户粘贴一个URL到Facebook发帖的编辑器里的时候,下面会瞬间自动生成一个那个网页的一些信息,比如图片,标题或前几行文字之类的。预估一下从用户粘贴进去到这个概要生成需要多少时间。一开始觉得这题挺奇怪,后来觉得其实就是要你把系统构架列出,分块预估,然后再把时间汇总起来。 结束后马上发现很多要点我都答漏了,比如DNS,loadbalancer。对一些部件的响应时间预估需要一些工作经验。