【面经】FaceBook

【电面】


电话面试弯曲职位,先是聊项目然后要求打印tree in order

很传统:先介绍简历 + 做题 + 问问题。
题目1:求二叉树所有从根开始到叶子的所有路径和。. Waral 鍗氬鏈夋洿澶氭枃绔�,
题目2:不能用递归,完成以上题目。
还挺简单的~发面经求涨RP啊~~


刚刚结束的第二轮facebook电话面试。还没结果呢所以结果就先选的other~求大米~~求offer~~~. 鍥磋鎴戜滑@1point 3 acres
居然做了三个题目。。
小哥迟到了5分钟打过来,那五分钟真是内心煎熬啊。。。
真的非常感谢地里朋友,所以赶紧发面经了。

1. flood fill。感谢地里面经:here and here and here 
就上面题目的各种变种,题目是有一个矩阵
1代表已经染色,0代表没有染色。
完成一个函数,
输入:矩阵a,整数x, 整数y
输出: 
返回一个矩阵,为以(x,y)点(0-based)为开始点的染色结果,将其周围区域染色,直到遇到已经染色的位置或边界为止。
若(x, y)已经染色则直接返回。注意:只能向上下左右四个方向染色。. 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
输入样例:
111111
111001
100110
2

1
输出样例:
111111
111001
111110

基本就是我在这里楼下贴的程序一样。注意处理边界条件。我用的DFS。代码如下:
  1. public class Solution {
  2.     private row = 0;
  3.     private col = 0;
  4.     . from: 1point3acres.com/bbs 
  5.     public void fillBlack(int[][] a, int x, int y) {
  6.         if (a == null || x == null || y == null) {
  7.             return;
  8.         }. 鍥磋鎴戜滑@1point 3 acres
  9.         
  10.         row = a.length;
  11.         col = a[0].length;. 鍥磋鎴戜滑@1point 3 acres
  12.         dfs(a, x, y);
  13.     }
  14.     
  15.     public void dfs(int[][] a, int i, int j) {. 鐗涗汉浜戦泦,涓€浜╀笁鍒嗗湴
  16.         if (i < 0 || i >= row || j < 0 || j >= col || a[i][j] != 0) {
  17.             return;
  18.         }. from: 1point3acres.com/bbs 
  19.         a[i][j] = 1;
  20.         dfs(a, i - 1, j);
  21.         dfs(a, i + 1, j);. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  22.         dfs(a, i, j + 1);
  23.         dfs(a, i, j - 1);
  24.      
  25.     } 
  26.     
  27.     
  28. }
复制代码
2. lintcode原题,merge two sorted array II. 连接请点击这里. 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
我们从后往前走即可。注意如果B数组提前结束,那么A剩下的就是在原地,所以不用再变了~要求in-place
代码如下:
  1. public class Solution {
  2.     public void mergeSortedArray(int[] a, int m, int[] b, int n) {. 鐗涗汉浜戦泦,涓€浜╀笁鍒嗗湴
  3.         if (a == null || b == null) {
  4.             return;
  5.         }
  6.         
  7.         int pos = m + n - 1;
  8.         int i = m - 1;
  9.         int j = n - 1;
  10.         while (i >= 0 && j >=0) {
  11.             if (a[i] >= b[j]) {
  12.                 a[pos] = a[i];.1point3acres缃�
  13.                 i--;
  14.             } else {. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  15.                 a[pos] = b[j];
  16.                 j--;
  17.             }
  18.             pos--;
  19.         }
  20.         
  21.         if (i < 0) {
  22.             while (pos >= 0) {
  23.                 a[pos] = b[j];. from: 1point3acres.com/bbs 
  24.                 j--;
  25.                 pos--;
  26.             }. 1point3acres.com/bbs
  27.         } 
  28.     }     
  29. }  
复制代码
3. 感谢面经~这是二叉树经典题目 BST转换成循环双向链表。leetcode类似题目请点击这里:Flatten Binary Tree to Linked List
其实我在面经贴:这里下面给出了自己的代码了。
具体思路是:
1. 拿出根节点。
2. 递归处理left, 找到左边最后一个节点,并且连接root到这个节点上。
3. 递归处理right, 找到右边最前面的节点,并且连接root到这个节点上。. 鍥磋鎴戜滑@1point 3 acres
4. return。

最后还需要处理一下头连接到尾巴的双向循环,补上就行,不贴code了。
  1. public class SolutionConvert {
  2.     public void solve(TreeNode root) {
  3.         if (root == null) {
  4.             return;
  5.         }
  6.         convertToDoubleLinkedList(root);           . From 1point 3acres bbs
  7.     }
  8.     . 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
  9.     public void convertToDoubleLinkedList(TreeNode root) {. 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
  10.         if (root == null) {. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  11.             return;
  12.         }. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  13.         if (root.left != null) {
  14.             TreeNode left = root.left;
  15.             convertToDoubleLinkedList(left);.鏈枃鍘熷垱鑷�1point3acres璁哄潧
  16.             while (left.right != null) {
  17.                 left = left.right;
  18.             }
  19.             left.right = root;
  20.             root.left = left;
  21.         }
  22.         if (root.right != null) {
  23.             TreeNode right = root.right;
  24.             convertToDoubleLinkedList(right);
  25.             while (right.left != null) {.鐣欏璁哄潧-涓€浜�-涓夊垎鍦�
  26.                 right = right.left;
  27.             }
  28.             right.left = root;
  29.             root.right = right;
  30.         }
  31.     }
  32.     . From 1point 3acres bbs
  33.     public void test(String[] args) {.1point3acres缃�
  34.         TreeNode a = new TreeNode("10");
  35.         TreeNode b = new TreeNode("12");
  36.         TreeNode c = new TreeNode("15");
  37.         TreeNode d = new TreeNode("25");
  38.         TreeNode e = new TreeNode("30");
  39.         TreeNode f = new TreeNode("36");
  40.         a.left = b;. 1point 3acres 璁哄潧
  41.         a.right = c;
  42.         b.left = d;
  43.         b.right = e;
  44.         c.left = f;.鐣欏璁哄潧-涓€浜�-涓夊垎鍦�
  45.         solve(a);
  46.         while (a.left != null) {
  47.             a = a.left;
  48.         }
  49.         while (a != null) {
  50.             System.out.print(a.val + " ");
  51.             a = a.right;. 1point3acres.com/bbs
  52.         }      
  53.     }. more info on 1point3acres.com
  54. }
复制代码
求赏大米~~求拿offer~~. visit 1point3acres.com for more.


楼主在加拿大McGill University读thesis的硕士。

总体时间线是:
2月5号在学校招聘会上投了F家的简历
2月10号收到面试邀请
3月4号完成第一轮电面, 面经 这里
3月20号完成第二轮电面,面经 这里。 当天晚上其实就收到邮件说下周要打电话,后来才知道就是发offer了。。。。
3月24号接到HR电话正式拿到offer。
申请的职位是做Product Generalist软件开发岗。
在门罗公园总部。本来说门罗已经没坑了要放我到seattle,出于某种未知原因又把我放到总部?HR原话是说,觉得你更suitable总部。。 求大神解答。

实习时间一律12周。除非学校要求16周coop才给学分,比如waterloo。
5月初到7月末,中间每两周开一个新批次入职,大家可以随意选择。

offer的一小段如下:
On behalf of Facebook, Inc. (the “Company” or “Facebook”), I am pleased to offer you the position of
Software Engineer Intern at the Company. You will be working out of the Company’s  US - CA - Menlo Park office
under the guidance of XXX. While working at Facebook, you’ll have the opportunity ............
. Waral 鍗氬鏈夋洿澶氭枃绔�,
Compensation:
a. Base Wage . In this position you will earn  a salary of $8*** per month. Your wages will be payable in
two equal payments per month ........
鏉ユ簮涓€浜�.涓夊垎鍦拌鍧�. 
b. Relocation . You will be eligible for relocation benefits as outlined in Attachment C:
Airfare or  Mileage Reimbursement

Shipping:  reimburse you up to  $300 toward shipping of personal items
.1point3acres缃�
Housing: place you in a  furnished apartment for the duration of your internship. The cost will be direct billed to Facebook.
Or  Housing Stipend : $1,000 / month

Transportation:  we will provide a  rental bike, lock and safety helmet for you for the duration of your internship.
. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
Facebook家情况简要介绍:
顶级互联网公司top2到3?员工平均股票市值数额是全球最高的。因为14年底只有9199名员工,然而G家有5万名。所以员工承担的责任maybe更大,创造的价值maybe更多?
每年新的全职和实习岗位从暑期结束就开始陆续放出。于是新学期一开学请立即开始找。不要像我一样2月份临时决定才开始。今年貌似刚好赶上F家扩招,所以机会还好。
F家北美研发中心有三个,分别是门罗公园总部,西雅图和纽约。当然各个州税不一样,规模也不同:
加州总部最大不用说了,条件最好,各种食堂免费,各种大牛在身边,出门左转 斯坦福
西雅图规模第二,F刚刚购置了能容纳2000人的新办公室。城市很美气候多雨,而且微软和Amazon总部也都在那,其他产业,比如航空制造业也很发达,波音总部在那,所以人脉不一定是码农??
纽约规模最小但是地处东北,如果地理上有要求的小伙伴们可以考虑,具体不了解。
待遇如上,另外员工可以公司免费吃喝。估计要胖的节奏了== 另外周末活动多多,每周末貌似都有活动。求介绍。
        职位方面,码农类职位分为产品(就是我做的)和后端(服务器端开发)。具体介绍是HR发给我的如下,就不翻译了。
基本意思就是一个做应用开发,比如网页前端、iOS或者Andriod,另一个是则是服务器后端开发。

        ◦        Product Generalist: an umbrella term for engineers that are passionate about designing and building engaging products. They will have a solid understanding of application development technologies and work mostly on the front end designing and building something from end to end. These engineers will primarily end up in product, ads, mobile, platform or growth teams... but these types of skills can be applicable in almost any team in Engineering.


        ◦        Systems Generalist: those who develop the general components on which the website and products are built. These types of candidates will be proficient in writing code to solve large scale backend problems and be less inclined towards dealing with front end development. The ideal candidate can write code in (but not limited to) C, C++, PHP and Python with strong experience in a Linux environment.


一路走来,我只能说感谢,也应该说只是运气好。我真的感谢各路神仙开恩,也感谢面试官没有为难我,更感谢地里面经。
也庆幸遇到的题目我多少还是会的以及面经里出现过的,所以结果还ok。我以后一定多做善事补补人品,可能人品都用光了
希望实习结束之后找全职工作顺利,希望能拿return offer,不拿也无所谓了。我人生已经混混乱不堪了其实。。以后可能写个帖子总结下。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值