回复: 27
跳转到指定楼层
上一主题 下一主题
收起左侧

Facekbook近期面试全汇总(包括各大英文面经网站)

   
全局:

2017(4-6月) 分析|数据科学类 硕士 全职@meta - 猎头 - Onsite 在线笔试  | | Other | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
快要面Facebook了,发现面经不是很全,尤其是英文发帖没有人好好总结过。心血总结了所有近期面试,整理如下,每个block是一个题。. Χ

整理很费精力,希望分享出来对大家都有用!
对了,还求大米!谢谢!!

.google  и
*************************
. 1point 3acres
Find sets of values in array whose sum is equal to some number.

Find the subarray within an array (containing at least TWO number) which has the largest sum.
. check 1point3acres for more.For example, given the array [-2,-1,-3,-4,-1],
the contiguous subarray [-2,-1] has the largest sum = -3.
try to do it in O(n) time
Followup, if input is stream, how to solve it
public int maxSubArray(int[] nums) {}.google  и
.1point3acres
A "derangement" of a sequence is a permutation where no element appears in its original position. For example ECABD is a derangement of ABCDE, given a string, may contain duplicate char, please out put all the derangement .google  и
public List<char[]> getDerangement(char[]){}

-baidu 1point3acres
Three sum with duplicate, pirnt all indexes, for example:
0 2 -2 -2
(0)(1)(2)(3)
print (0, 1, 2) (0, 1, 3)
can you do it use n^2 (or less) time complexity with as less space as possible?
public List<List<Integer>> threeSum(int[] nums) {}

Given an array of integers:
1. rearrange the array such that all non-zero members appear on the left of the array (order is not important)
2. return the number of non-zero members
e.g. [1,2,0,5,3,0,4,0] => [1,2,5,3,4,0,0,0] and return 5. The non-zero array members can be in any order.


Given an array of task and k wait time for which a repeated task
needs to wait k time to execute again. please rearrange the task .1point3acres
sequences to minimize the total time to finish all the tasks. . .и
Example
Tasks = 111222, k = 2,
One possible task sequence is
12_12_12,
another possible task sequence is 21_21_21
thus you shoud return 8
public int getMiniTime(int[] nums, int k){
}
follow up, output one of the sequence 12_12_12, or 21_21_21.--


Given an unsorted array, sort it in such a way that the first
element is the largest value, the second element is the smallest,
the third element is the second largest element and so on. . Χ
[2, 4, 3, 5, 1] -> [5, 1, 4, 2, 3]
can you do it without using extra space
public void sortAlternate(int[] nums){}

.
Given a number of tasks (T) and servers (S), find out if the tasks can be accommodated on the servers. Each Task has a number of Units and each server has a number of Slots on which Units can run.
The only condition is that two Units of the same Task "cannot" run on the same Server.
Servers
S[0] = "SS1", "SS2", "SS3", SS4 //Slots // 4 -> 3 -> 2 -> 1
S[1] = "SS1", "SS2" // 2 -> 1 -> 0 -> false
S[2] = "SS1", "SS2", SS3, SS4, SS5 // 5 -> 4 -> 3 -> 2
S[3] = "SS1", "SS2", SS3, SS4, SS5 // 5 -> 4 -> 3 -> 2 .--
Example:
S[0] = 4 -baidu 1point3acres
S[1] = 3
S[2] = 5
S[3] = 5
... . 1point3acres
Tasks
T[0] = U0, U1, U2, U3 //Tasks
T[1] = U0, U1
T[2] = U0, U1, U2 . Waral dи,
... . Χ
. 1point 3 acres
Example:
T[0] = 4
T[1] = 2
T[2] = 3

implement
boolean boolean CanRunTasks(S[], T[]){
}


Given some email ids, and a similarity function which says whether two email ids are similar, determine all the sets of email ids that are similar to each other.


You have a string consisting of open and closed parentheses, but parentheses may be imbalanced.
Make the parentheses balanced and return the new string.


Given an array of integers greater than zero, find if it is possible to split it in two (without reordering the elements), such that the sum of the two resulting arrays is the same. Print the resulting arrays.. Χ


There is a bunch of tasks, each have different time to complete, task is independent, and then there are some workers,
How to allocate tasks to these workers to minimize the total time to complete all the task. The tasks can be randomly picked from the task list.
.google  иExample
Task: 2,2,3,7, 1
. Worker: 2.
Return 8, because the first worker can work on the first three tasks : 2 + 2 + 3 = 7, and the second worker can work on the last two tasks : 7 + 1 = 8, so the total time to finish all the task is 8.
public int getMini(int[] tasks, int k)


We have a List of FlightRoute
public static class FlightRoute {
        String from;
        String to;
        int time;
        ....
    }
and write a function to find Shortest Path: findShorestPath(String start, String end, List<FlightRoute>routes)


-baidu 1point3acres
Iterate over a singly linked list backwards. Call print on each node.
Example: The list A->B->C should print as
"C B A"
class Node {
  public Node next;
  public String value;
}
There are 4 solutions
1) recursive
2) iterative with O(n) memory
3) iterative with O(1) memory and O(n2) runtime . check 1point3acres for more.
4) iterative with O(1) memory and O(n) runtime (for this solution the initial list may be modified)
Explain all 4 solutions and write the code for solutions 3 and 4


You are given an array of integers.
Write an algorithm that brings all nonzero elements to the left of the array, and returns the number of nonzero elements.
The algorithm should operate in place, i.e. shouldn't create a new array.
The order of the nonzero elements does not matter. The numbers that remain in the right portion of the array can be anything. .google  и
Example:
given the array [ 1, 0, 2, 0, 0, 3, 4 ],
a possible answer is [ 4, 1, 3, 2, ?, ?, ? ], 4 non-zero elements, where "?" can be any number.
Code should have good complexity and minimize the number of writes to the array.
. 1point3acres
. 1point 3 acres
. ----
Given:
a encoded to 1
b encoded to 2
....
z encoded to 26 -baidu 1point3acres
You can translate a number to a string:
'123' can be translated to 'abc'
but also can be translated to 'aw','lc' which gives 3 total translations
'12' can be translated to 'ab' and 'l' -> 2 translations . 1point3acres.com
Write a function to get the number of valid combinations from a number like '123123123'


You have a string of numbers, i.e. 123. You can insert a + or - sign in front of ever number, or you can leave it empty. Find all of the different possibilities, make the calculation and return the sum.
For example;
+1+2+3 = 6
+12+3 = 15 ..
+123 = 123
+1+23 = 24
...
-1-2-3 = 6
...
Return the sum of all the results.


Given the newest 100 entries of a person's facebook newsfeed. How would you rank the entries. The (for the user) most important ones should be ranked first. Which features would you use and how do you train/improve your model (machine learning)?


Design a algorithm to initialize the board of Candy Crush Saga. With M x N board, Q types of candies. (Rules: no 3 for run after initialization, must contain at least one valid move at the beginning). 1point 3 acres

. Waral dи,
Q: Weighted meeting room
Given a series of meetings, how to schedule them. Cannot attend more than a meeting at the same time. Goal is to find maximum weight subset of mutually non-overlap meetings.
class Meeting:. check 1point3acres for more.
def __init__(self):
    self.startTime
    self.endTime
    self.weight. .и
. ----

Given preorder traversal [5,3,2,4,8,7,9] of a BST, how do we identify the leaf nodes without building the tree ?
.1point3acres

Given estimated stock quotes, in an array, print the maximum profit from a buy and sell. i.e [19, 22, 15, 35, 40, 10, 20] would show a profit of 25(40 -15). The sale must come after the buy. Solve this in O(N) time.

. 1point3acres
Given many coins of 3 different face values, print the combination sums of the coins up to 1000. Must be printed in order. ..
eg: coins(10, 15, 55)
print:
10
15
20
25
30 -baidu 1point3acres
.
. . Χ
.
1000

您好!
本帖隐藏的内容需要积分高于 108 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 108 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
. From 1point 3acres bbs

Given an array of positive integers and a target total of X, find if there exists a contiguous subarray with sum = X ..
[1, 3, 5, 18] X = 8 Output: True . Waral dи,
X = 9 Output: True
X = 10 Output: False
X = 40 Output :False


评分

参与人数 23大米 +248 收起 理由
gatsby7d + 3 很有用的信息!
smileonly_718 + 3 很有用的信息!
katefly + 3
admin + 100 感谢分享!
mat_xu + 3 感谢分享!

查看全部评分


上一篇:udel统计chase barclays salliemae面经
下一篇:Credit Suisse Systematic Market Making Group Quantatitive Trading onsite 面试。

本帖被以下淘专辑推荐:

推荐
RXNT 2017-6-6 12:45:23 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

推荐
cyxmomo 2018-1-27 12:16:27 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

推荐
googletalk 2017-6-5 13:41:17 | 只看该作者
全局:
csytracy 发表于 2017-5-15 22:26
请问lz这些好像都是算法题啊?你搜集的是fb ds面试中的算法题吗?(感觉有点多。。。)还是fb swe 的算法题 ...
-baidu 1point3acres
对呀,好像DS不需要这么多编程题吧?这个可能是SDE面试的吧?
回复

使用道具 举报

🔗
ft3085273 2017-5-5 02:25:43 | 只看该作者
全局:
LZ太用心了 辛苦辛苦 good luck
回复

使用道具 举报

🔗
Lolipop 2017-5-5 03:47:58 | 只看该作者
全局:
楼主辛苦!英文面经网站除了Glassdoor还有啥?
回复

使用道具 举报

🔗
mchzh 2017-5-5 05:26:56 | 只看该作者
全局:
楼主是面new grad还是experience?
回复

使用道具 举报

🔗
lch04 2017-5-5 05:52:48 | 只看该作者
本楼:
全局:
感谢分享
回复

使用道具 举报

🔗
mayday1234 2017-5-5 07:37:26 | 只看该作者
全局:
请问楼主从哪里搜的资料呢 谢谢!!
回复

使用道具 举报

🔗
jemi 2017-5-5 08:44:57 | 只看该作者
本楼:
全局:
xiexie
回复

使用道具 举报

🔗
 楼主| xlblue 2017-5-5 08:45:50 | 只看该作者
全局:
mayday1234 发表于 2017-5-5 07:37
请问楼主从哪里搜的资料呢 谢谢!!

glassdoor, careercup, reddit, 反正google呗
回复

使用道具 举报

🔗
googletalk 2017-5-15 12:32:51 | 只看该作者
全局:
thanks a lot!
回复

使用道具 举报

🔗
csytracy 2017-5-15 22:26:16 | 只看该作者
全局:
请问lz这些好像都是算法题啊?你搜集的是fb ds面试中的算法题吗?(感觉有点多。。。)还是fb swe 的算法题啊?谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表