【电面】

电话面试弯曲职位,先是聊项目然后要求打印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. row = a.length;
  10. col = a[0].length;. 鍥磋鎴戜滑@1point 3 acres
  11. dfs(a, x, y);
  12. }
  13. public void dfs(int[][] a, int i, int j) {. 鐗涗汉浜戦泦,涓€浜╀笁鍒嗗湴
  14. if (i < 0 || i >= row || j < 0 || j >= col || a[i][j] != 0) {
  15. return;
  16. }. from: 1point3acres.com/bbs
  17. a[i][j] = 1;
  18. dfs(a, i - 1, j);
  19. dfs(a, i + 1, j);. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  20. dfs(a, i, j + 1);
  21. dfs(a, i, j - 1);
  22. }
  23. }

复制代码

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. int pos = m + n - 1;
  7. int i = m - 1;
  8. int j = n - 1;
  9. while (i >= 0 && j >=0) {
  10. if (a[i] >= b[j]) {
  11. a[pos] = a[i];.1point3acres缃�
  12. i--;
  13. } else {. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴
  14. a[pos] = b[j];
  15. j--;
  16. }
  17. pos--;
  18. }
  19. if (i < 0) {
  20. while (pos >= 0) {
  21. a[pos] = b[j];. from: 1point3acres.com/bbs
  22. j--;
  23. pos--;
  24. }. 1point3acres.com/bbs
  25. }
  26. }
  27. }

复制代码

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,不拿也无所谓了。我人生已经混混乱不堪了其实。。以后可能写个帖子总结下。

.

【面经】FaceBook相关推荐

  1. [FaceBook]测试、发布和分享小游戏

    FaceBook小游戏 测试.发布和分享小游戏 对于小游戏,您现在可以十分轻松地在本地测试开发版本,自动完成发布流程,以及与团队分享编译版本.本文档会详细说明这些步骤. 通过本地服务器测试游戏 小游戏 ...

  2. Facebook 与 Google 正在主导在线身份验证市场

    OpenID 公司 JanRain 的一项研究发现,用户在第三方网站进行身份验证时,最喜欢使用 Google 和 Facebook 的身份验证服务.Facebook 的验证服务 在媒体, 零售,技术等 ...

  3. 机器学习(实战)facebook地址预测

    目录 一.读取数据 二. 数据处理 1.缩小数据范围 2.得到正常时分秒 2-1.时间戳化时分秒 2-2.得到时间列表 2-3.添加时间信息到数据data中 3.得到数据集 3-1.获取各地点签到次数 ...

  4. Facebook如何使用Avartarnode提升HDFS可靠性

    在不久前的Hadoop峰会上,Facebook的工程师Andrew Ryan分享了他们如何使用Namenode和Avatarnode提升HDFS可靠性的方法.Ryan从2009年开始,就参与到了Fac ...

  5. Facebook的实时Hadoop系统

    原文地址: http://blog.solrex.org/articles/facebook-realtime-hadoop-system.html 作者:杨文博 Facebook 在今年六月 SIG ...

  6. Facebook性能大提升的秘密:HipHop

    facebook / hiphop-php https://github.com/facebook/hiphop-php Facebook神秘的PHP项目HipHop for PHP终于揭开面纱.这个 ...

  7. Facebook再曝数据丑闻删除应用数据仍会被泄漏

    据外媒报道,道德黑客.漏洞赏金猎人Inti De Ceukelaire于昨日披露,名为"NameTests"的第三方测验应用令1.2亿Facebook用户面临数据泄露风险,这进一步 ...

  8. 明文存密码成惯例?Facebook 6 亿用户密码可被 2 万员工直接看

    近日,外媒发布了一份互联网安全的调研报告,报告中称Facebook曾将6亿用户的账号密码使用明文存储,且可以被Facebook内部员工随意搜索查看.据Facebook方面的消息人士称,纯文本存档的用户 ...

  9. 端到端对话模型新突破!Facebook发布大规模个性化对话数据库

    作者|Pierre-Emmanuel Mazare 等 译者|郝毅 编辑|Debra 出处丨 AI 前线 AI 前线导读:聊天机器人是目前非常流行的一种人工智能系统.目前大部分聊天机器人的衔接性都不是 ...

  10. Facebook将React的许可改为MIT

    Facebook决定将React原先的BSD+Patents许可改为MIT,这样其他公司就可以将React包含在Apache基金会的项目当中,并消除与开源社区之间关系的不确定性. \\ Faceboo ...

最新文章

  1. vbsedit无法创建空文档_创建恢复驱动器(U盘)
  2. 鸿蒙智慧电视,华为的鸿蒙电视与智能电视有什么区别
  3. 在Hi3531上运行QT
  4. 【报名开启】阿里云线下Workshop让你玩转ECS 快速搭建云上博客
  5. %@include%和jsp:include的区别
  6. jee-weapp是一套基于jfinal,dubbo微服务开发的微信小程序商城项目,首次开放全部拼团前后台源码
  7. Leetcode每日一题:514.freedom-trail(自由之路)
  8. Ultra-QuickSort(离散化)
  9. 医院耗材管理系统开发_2
  10. “不死鸟”号历险记---和扫雷过不去篇(无厘头版)
  11. ASP.NET 教程
  12. nodejs 运行后报错 Error: Couldn‘t find preset “es2015“ relative to directory
  13. 汇编语言:写一个简单的音乐程序
  14. switch判断语句用法
  15. python中关于np.array初始化不同维度矩阵的有趣现象
  16. 《通信原理》(2):信息量及平均信息量
  17. 解决“c#:未将对象引用设置到对象的实例”
  18. Java Statement一次执行多条sql语句
  19. ESXi处理主机错误无法进入维护模式
  20. 关于烈马、将军攻击网站假墙攻击防御方案以及轮询脚本

热门文章

  1. Android中使用ps命令查看进程PID
  2. web前端——html固定格式介绍
  3. ROS暑期学校暨人工智能与机器人视频回放和分享信息(2022)
  4. 果动3D应用引领游戏娱乐新玩法
  5. 「周报」本周你需要了解的13个设计工具
  6. PB通过ODBC链接MYSQL_odbc技术小结(结合pb)
  7. 通过url打开图片为PIL或numpy
  8. 张小龙:突然搭错了神经,写了个邮件,微信就此开始!
  9. 程序员必知的十大基础实用算法及其讲解
  10. 基于残差神经网络的交通标志识别算法研究与应用实现