📣 独立日限时特惠: VIP通行证立减$68
回复: 13
跳转到指定楼层
上一主题 下一主题
收起左侧

roblox karat

全局:

2019(10-12月) 码农类General 硕士 全职@roblox - 网上海投 - 技术电面  | | Other | 在职跳槽

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

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

x
感谢地里的面经,原题
之前没有人说过思路,我就说说我的思路吧
q1就建立一个map和一个set,map建立child->parent的list,list size为1的话就one parent是答案, set把全部node加进去,然后再剔除map里面的key就是no parent的。最后问了时间和空间复杂度
q2 一样都要建立map,建立一个set存一个node的所有parent,再遍历另一个node的parent,一旦有common就返回true, 遍历我用queue来做的
q3 我用dfs

做出来最重要结论是

// Question 3

// Suppose we have some input data describing a graph of relationships between parents and children over multiple generations. The data is formatted as a list of (parent, child) pairs, where each individual is assigned a unique integer identifier.

// For example, in this diagram, the earliest ancestor of 6 is 14, and the earliest ancestor of 15 is 2.

//          14
//          |
//   2      4
//   |    / | \
//   3   5  8  9
//  / \ / \     \
// 15  6   7    11

// Write a function that, for a given individual in our dataset, returns their earliest known ancestor -- the one at the farthest distance from the input individual. If there is more than one ancestor tied for "earliest", return any one of them. If the input individual has no parents, the function should return null (or -1).

// Sample input and output:

// parentChildPairs1 = [
//     (2, 3), (3, 15), (3, 6), (5, 6), (5, 7),
//     (4, 5), (4, 8), (4, 9),
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
s diagram, 3 is a child of 1 and 2, and 5 is a child of 4:

// 1   2    4
//  \ /   / | \
//   3   5  8  9
//    \ / \     \
//     6   7    11

// Write a function that takes this data as input and returns two collections: one containing all individuals with zero known parents, and one containing all individuals with exactly one known parent.

// Sample input/output (pseudodata):

// parentChildPairs = [
//     (1, 3), (2, 3), (3, 6), (5, 6),
//     (5, 7), (4, 5), (4, 8), (4, 9), (9, 11)
// ]

// Output may be in any order:

// findNodesWithZeroAndOneParents(parentChildPairs) => [
//   [1, 2, 4],       // Individuals with zero parents
//   [5, 7, 8, 9, 11] // Individuals with exactly one parent
// ]

// n: number of pairs in the input

评分

参与人数 5大米 +32 收起 理由
sccnju + 2 给你点个赞!
highfive + 2 给你点个赞!
yuanqijiong + 2 给你点个赞!
匿名用户-JZNLY + 25
hptg1994 + 1 很有用的信息!

查看全部评分


上一篇:小众voleon MLE 面经
下一篇:谷歌 店面面经

本帖被以下淘专辑推荐:

  • · Indeed|主题: 76, 订阅: 1
推荐
 楼主| ohohgod 2019-10-20 01:23:13 | 只看该作者
全局:
hptg1994 发表于 2019-10-19 17:21
楼主,您是onsite后hr说今年公司不再sponsor h1b的嘛?我在考虑要不要面下去

onsite前有个manager的call,他最后面了,这个公司我也不建议去,都是.net,技术太老旧了,manager也说的很委婉说自己和硅谷公司不同,但是拿个面试可以去练习一下不错的

评分

参与人数 1大米 +1 收起 理由
匿名账號 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

推荐
 楼主| ohohgod 2019-11-26 08:38:13 | 只看该作者
全局:
匿名账號 发表于 2019-11-25 07:55
我也要和tech lead电话面。能问下和tech lead半个小时都聊了什么吗?lead 名字缩写是KC吗?

不是,hiring manager 就随便聊,给你介绍一下几个组都在干嘛没有算法,这个公司都是用c#,而且没有h1b不行,他们只做trasnfer不做sponsor,fyi
回复

使用道具 举报

推荐
 楼主| ohohgod 2019-11-27 07:03:18 | 只看该作者
全局:
匿名账號 发表于 2019-11-26 09:15
啊啊啊 不sponsor 那看来我是凉了 就当聊天了

当然你也可以去面试当练习,你说你h1b rfe云云之类的,拿到offer不接就是了,而且我也不建议去
回复

使用道具 举报

🔗
Taotao666 2019-10-16 06:19:18 | 只看该作者
全局:
求稳楼主有后续消息了吗?
回复

使用道具 举报

🔗
 楼主| ohohgod 2019-10-17 00:53:21 | 只看该作者
全局:
Taotao666 发表于 2019-10-16 06:19
求稳楼主有后续消息了吗?

onsite了,之前跟tech lead有个30分钟的电话
回复

使用道具 举报

🔗
 楼主| ohohgod 2019-10-18 14:59:46 | 只看该作者
全局:
这个公司不支持h1b,你有H1B可以transfer,不支持抽签,但拿个面试也不错的。组里核心都是用.net .net core技术感觉不是很适用跳槽,大家懂的
回复

使用道具 举报

🔗
hptg1994 2019-10-19 17:21:14 | 只看该作者
全局:
楼主,您是onsite后hr说今年公司不再sponsor h1b的嘛?我在考虑要不要面下去
回复

使用道具 举报

🔗
hptg1994 2019-10-20 01:43:11 | 只看该作者
全局:
ohohgod 发表于 2019-10-20 01:23
onsite前有个manager的call,他最后面了,这个公司我也不建议去,都是.net,技术太老旧了,manager也说的 ...

好的,感谢!
回复

使用道具 举报

🔗
匿名账號 2019-11-25 07:55:50 | 只看该作者
全局:
ohohgod 发表于 2019-10-16 11:53
onsite了,之前跟tech lead有个30分钟的电话

我也要和tech lead电话面。能问下和tech lead半个小时都聊了什么吗?lead 名字缩写是KC吗?
回复

使用道具 举报

全局:
ohohgod 发表于 2019/11/26 08:38:13
不是,hiring manager 就随便聊,给你介绍一下几个组都在干嘛没有算法,这个公司都是用c#,而且没有h1b不行...
啊啊啊 不sponsor 那看来我是凉了 就当聊天了
回复

使用道具 举报

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

本版积分规则

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