我是家长,妈妈一枚,突然想写点什么(不太会写)

一亩三分地论坛

 找回密码
 Sign Up 注册获取更多干货
码农求职神器Triplebyte:
不用海投,内推多家公司面试
[Google级团队]:实时大数据分析领域践行者
北京/深圳-大数据/搜索/机器学习职位
日志易机器大数据行业践行者Web/大数据/机器学习等职位-北京or深圳
把贵司招聘信息放这里
查看: 4255|回复: 1
收起左侧

整理一下facebook见过的面经

[复制链接] |试试Instant~ |关注本帖
NeptuneFrank 发表于 2015-10-19 03:35:29 | 显示全部楼层 |阅读模式

2015(1-3月) 码农类General 硕士 全职@Facebook - 内推 - 技术电面  | Pass | 在职跳槽

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

您需要 登录 才可以下载或查看,没有帐号?Sign Up 注册获取更多干货

x

1.+2 3 sum


2. Given set of points in 2d grid space. Find a grid point such that sum
of distance from all the points to this common point is minimum.

鏉ユ簮涓浜.涓夊垎鍦拌鍧. 3. Print a binary tree by vertical level order. 1point3acres.com/bbs

4. Calculate the average of each level of a tree.
. from: 1point3acres.com/bbs
5. how do you find the lowest common ancestor of two nodes in a binary tree. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴

6. ??
1--a
2--b
...
26--z
given a digit , return the count of the possible output
eg. '1313' --- 4
acac mac mm acm
'101' --1
ja
cannot discard any digit .
. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴


7.Given a matrix, calculate the sum of a sub matrix given the start and end indices of the sub matrix (do dynamical programming on this)
.1point3acres缃
8. sort 3 color in array (use self-over writing with two ends.).

. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
9.+1 implement sqrt() with integer (use Binary Search.)
. more info on 1point3acres.com
10. find if one string is one edit distance away from the other string (check all possible cases)

11. get the n-th Fibonacci number

12. find the depth of a binary tree,


13. merge two arrays, A + B -> A ( do it in-place, i feel. Why do not you merge sorted arrays from their largest element? (from max instead? very good question))


14. Check to see if one array is a subset of another.. more info on 1point3acres.com

15. balance trees with weight???
. from: 1point3acres.com/bbs
16. add binary(leetcode)

17.+1 binary tree print all paths from root to leef
How to do it iteratively? 用一个stack实现preorder来做?-google 1point3acres

/*
Given a binary tree, print out all of its root-to-leaf
paths, one per line. Uses a recursive helper to do the work.
*/
void printPaths(struct node* node) {. 鍥磋鎴戜滑@1point 3 acres
  int path[1000];
  printPathsRecur(node, path, 0);
}

/*
Recursive helper function -- given a node, and an array containing
the path from the root node up to but not including this node,
print out all the root-leaf paths.
*/
void printPathsRecur(struct node* node, int path[], int pathLen) {
  if (node==NULL) return;. from: 1point3acres.com/bbs
. 1point 3acres 璁哄潧
  // append this node to the path array
  path[pathLen] = node->data;. visit 1point3acres.com for more.
  pathLen++;

  // it's a leaf, so print the path that led to here
  if (node->left==NULL && node->right==NULL) {. 鍥磋鎴戜滑@1point 3 acres
    printArray(path, pathLen);.鏈枃鍘熷垱鑷1point3acres璁哄潧
  }
  else {
  // otherwise try both subtrees
    printPathsRecur(node->left, path, pathLen);
    printPathsRecur(node->right, path, pathLen);
  }
}

// Utility that prints out an array on a line.
void printArray(int ints[], int len) {
  int i;
  for (i=0; i<len; i++) {
    printf("%d ", ints);
  }
  printf("\n");. 1point 3acres 璁哄潧
}


18. clone graph
. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
19. count and say(leetcode)

20. Divide without division
.鐣欏璁哄潧-涓浜-涓夊垎鍦

21. Big Integer multiplication. (optimization required, how to do 8 digits*8 digits, etc).
.鐣欏璁哄潧-涓浜-涓夊垎鍦
. 鍥磋鎴戜滑@1point 3 acres

23.+1 Push all the zero's of a given array to the end of the array. In place only. Ex 1,2,0,4,0,0,8 becomes 1,2,4,8,0,0,0


24. You're given an array of integers(eg [3,4,7,1,2,9,8]) Find the index of values that satisfy A+B = C + D, where A,B,C & D are integers values in the array.
. more info on 1point3acres.com
Eg: Given [3,4,7,1,2,9,8] array.鏈枃鍘熷垱鑷1point3acres璁哄潧
The following
3+7 = 1+ 9 satisfies A+B=C+D
so print (0,2,3,5)
. 1point 3acres 璁哄潧

25. Find intersection of 2 sorted arrays.




.1point3acres缃

评分

3

查看全部评分

本帖被以下淘专辑推荐:

 楼主| NeptuneFrank 发表于 2015-10-19 03:36:05 | 显示全部楼层
highlight的是见过多次的
回复 支持 反对

使用道具 举报

本版积分规则

提醒:发帖可以选择内容隐藏,部分板块支持匿名发帖。请认真读完以下全部说明:

■隐藏内容方法: [hide=200]你想要隐藏的内容比如面经[/hide]
■意思是:用户积分低于200则看不到被隐藏的内容
■可以自行设置积分值,不建议太高(200以上太多人看不到),也不建议太低(那就没必要隐藏了)
■建议只隐藏关键内容,比如具体的面试题目、涉及隐私的信息,大部分内容没必要隐藏。
■微信/QQ/电子邮件等,为防止将来被骚扰甚至人肉,以论坛私信方式发给对方最安全。
■匿名发帖的板块和方法:http://www.1point3acres.com/bbs/thread-405991-1-1.html

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明

custom counter

GMT+8, 2018-4-24 05:26

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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