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

BB面经总结

全局:

2018(1-3月) 码农类General 博士 全职@bloomberg - 校园招聘会 - 校园招聘会  | | Pass | 应届毕业生

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

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

x
上个月面的,背靠背靠背?前两天on campus interview,第三天onsite面manager和HR。

Day 1:
国人大哥和印度小哥,一共面了四题
1. Given a sorted array, return a balanced binary search tree. 直接找中间的值,然后recursion
2. Given a tree and three nodes p, node1, node2, return a boolean to indicate whether node2 is a descendant of node1 under the tree rooted at p. 就是说必须同时node1node2都是p
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
anager问了相关的。
2. 操作系统的一些问题,static variables, stack,heap,virtual memory,segmentation fault,TLB,page table.
3. HR 问了些杂七杂八的..比如talk about one big achievement you made? why BB?..



补充内容 (2018-3-6 03:54):
看了其他人的面经,然后想起来第四题了,就是个UDP传输,详见这位同学的帖子

评分

参与人数 3大米 +20 收起 理由
匿名用户-CHECT + 16
flyMontain + 1 很有用的信息!
zhuyingcau + 3 给你点个赞!

查看全部评分


上一篇:IXL Learning 全职电面
下一篇:Oracle cloud 面试题
🔗
jasonyang04 2018-3-6 02:20:33 | 只看该作者
全局:
请问楼主Jump那题怎么做的?难道就是个loop,直到stair变成stair + 1?
回复

使用道具 举报

🔗
 楼主| miluChen 2018-3-6 03:41:20 | 只看该作者
全局:
jasonyang04 发表于 2018-3-6 02:20
请问楼主Jump那题怎么做的?难道就是个loop,直到stair变成stair + 1?

可以那么做啊,但要求不能用loop

补充内容 (2018-3-6 03:51):
需要用recursion
回复

使用道具 举报

🔗
LUOLUOLNSH 2018-3-6 10:44:28 | 只看该作者
全局:
miluChen 发表于 2018-3-6 03:41
可以那么做啊,但要求不能用loop

补充内容 (2018-3-6 03:51):

lz recursion怎么做的?多谢 :)
回复

使用道具 举报

🔗
helloworld00 2018-3-7 06:45:57 | 只看该作者
全局:
3. Given a string and a character 'c', return an array of integers which represent the shortest distance from the character 'c' in the string.
    e.g.: string : "whattheduck", character 'c': 't'. The shortest distance between 'w' and 't' is 3.
            return [3,2,1,0,0,1,2,3,4,5,6].


呃,请问你这个到底是给了一个char 'c' 还是 给了个 't' ?

那个 shortest distance between ‘w’ and ‘t’ is 3,为什么又要算 w 的距离?whattheduck 里面,w和第一个t的距离也不是3而是2吧。。。

回复

使用道具 举报

🔗
oldwhite 2018-3-8 11:00:37 | 只看该作者
全局:
jump那题的描述是不是有问题?
不管跳多少次,走+1的概率和走-1的概率都是一样的呀
回复

使用道具 举报

🔗
 楼主| miluChen 2018-3-27 02:16:23 | 只看该作者
全局:
LUOLUOLNSH 发表于 2018-3-6 10:44
lz recursion怎么做的?多谢 :)

Sorry for coming back so late. I did not get the chance to check this post.
One possible solution:

// function that has 50% probability jump up and 50% fail down
void Jump(void);
// function that guarantees jump up (given infinite stack space)
void JumpUp(void) {
     helper(0);
}
void helper(int n) {
   if (n == 1)
       return;
   n += Jump() ? 1 : -1;
   helper(n);
}

As a further follow up for you to think about it: solve the same problem without while or for loop, and you are not allowed to pass parameters to functions or use global variables.

评分

参与人数 1大米 +3 收起 理由
取个响亮的名号 + 3 给你点个赞!

查看全部评分

回复

使用道具 举报

全局:
miluChen 发表于 2018-3-26 13:16
Sorry for coming back so late. I did not get the chance to check this post.
One possible solution ...

请教下楼主,follow-up不用循环语句该怎么做呢?还会加米的,感谢!
回复

使用道具 举报

🔗
 楼主| miluChen 2020-2-14 05:05:32 | 只看该作者
全局:
取个响亮的名号 发表于 2020-1-29 20:40
请教下楼主,follow-up不用循环语句该怎么做呢?还会加米的,感谢!

那你给我多加点啊,蛤蛤,没想到现在还有人看到这个。

  1. #include <iostream>
  2. #include <cstdlib>

  3. struct Robot {
  4.     int count;

  5.     int move() {
  6.         if (rand() / RAND_MAX < 0.5) {
  7.             count++;
  8.             return 1;
  9.         }
  10.         else {
  11.             count--;
  12.             return -1;
  13.         }
  14.     }
  15. };

  16. void goUp(Robot &robot) {
  17.     if (robot.move() == 1)
  18.         return;
  19.     goUp(robot);
  20.     goUp(robot);
  21. }

  22. int main() {
  23.     struct Robot robot = Robot();
  24.     robot.count = 0;

  25.     for (int i=0; i<10; i++) {
  26.         goUp(robot);
  27.         std::cout << robot.count << std::endl;
  28.     }

  29.     return 0;
  30. }
复制代码

评分

参与人数 1大米 +3 收起 理由
取个响亮的名号 + 3 给你点个赞!

查看全部评分

回复

使用道具 举报

全局:
miluChen 发表于 2020-2-13 16:05
那你给我多加点啊,蛤蛤,没想到现在还有人看到这个。

[mw_shl_code=cpp,true]#include

if failure won't step down but stays on the same floor, how to modify the code?
回复

使用道具 举报

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

本版积分规则

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