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

Zenefits skype

 
全局:

2015(4-6月) 码农类General 博士 全职@zenefits - 网上海投 - 技术电面  | | Other | 应届毕业生

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

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

x
下午刚面的,我居然都没有把题目看完,就只看了前3行的题目,外加一个小图,根本就没注意还有滚动条,居然我也写了好几十行的代码,花了大概半个小时吧,然后面试官居然也没说什么,感觉他说话有气无力的,估计他一天没吃饭。。。。面试前半个小时刚收到amazon的offer,想去amazon了,这个也就那么回事儿了。

题目就一道如下,大家参考下吧
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies

The list of errors with their codes is as follows:

Error Code      Type of error
E1                 More than 2 children
E2                 Duplicate Edges
E3                 Cycle present
E4                 Multiple roots
E5                 Any other error   

Input Format:
Input must be read from standard input.
Input will consist of on line of parent-child pairs. Each pair consists of two node names separated by a single comma and enclosed in parentheses. A single space separates the pairs.

Output:
The function must write to standard output.
Output the given tree in the S-expression representation described above.
There should be no spaces in the output.

Constraints:
  • There is no specific sequence in which the input (parent,child) pairs are represented.
  • The name space is composed of upper case single letter (A-Z) so the maximum size is 26 nodes.
  • Error cases are to be tagged in the order they appear on the list. For example, if one input pair raises both error cases 1 and 2, the output must be E1.


Sample Input #00
(B,D) (D,E) (A,B) (C,F) (E,G) (A,C)
Sample Output #00

(A(B(D(E(G))))(C(F)))
Sample Input #01
(A,B) (A,C) (B,D) (D,C)
Sample Output #01
E3
Explanation
Node D is both a child of B and a parent of C, but C and B are both child nodes of A. Since D tries to attach itself as parent to a node already above it in the tree, this forms a cycle.


补充内容 (2015-4-16 05:19):
明天还要epic onsite,发个面筋攒rp

补充内容 (2015-4-16 09:04):
咋没人给我个米啥的。。。唉:-(

评分

参与人数 11大米 +336 收起 理由
admin + 300
xjbTalk + 10 感谢分享!
kennethinsnow + 3 感谢分享!
tiantiana + 3 谢谢你的介绍!
douya + 3 感谢分享!

查看全部评分


上一篇:求Dropbox online test 面经
下一篇:Amazon电话面试

本帖被以下淘专辑推荐:

推荐
lzd1127 2015-5-1 05:45:21 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies

评分

参与人数 1大米 +3 收起 理由
finger + 3 很有用的信息!

查看全部评分

回复

使用道具 举报

推荐
M_Jason 2015-8-15 09:34:46 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

推荐
EchoO 2015-4-28 10:32:13 | 只看该作者
全局:
applepie11 发表于 2015-4-28 10:23
只有出度没入度的node

(′・ω・`)
是我犯二了
多谢~
回复

使用道具 举报

🔗
 楼主| applepie11 2015-4-16 05:00:12 | 只看该作者
全局:
哎呀,tree没显示好,反正就是左右parent-child 那么插入,大家自行想象吧
回复

使用道具 举报

🔗
liushen 2015-4-16 05:40:41 | 只看该作者
全局:
非常感谢楼主面经!楼主有amazon的offer了,也估计不在乎Zenefits了吧。。。哈哈
对了,能问一下楼主是new grads吗?我找人内退了amazon,没人理我,打听说是amazon的new grads都招满了。。。
回复

使用道具 举报

🔗
limingli1991 2015-4-16 06:14:49 | 只看该作者
全局:
同问为什么Amazon没人鸟我。。。
回复

使用道具 举报

🔗
ohohgod 2015-4-16 07:03:02 | 只看该作者
全局:
有没有高手来解答。。。
回复

使用道具 举报

🔗
 楼主| applepie11 2015-4-16 09:04:08 | 只看该作者
全局:
liushen 发表于 2015-4-16 05:40
非常感谢楼主面经!楼主有amazon的offer了,也估计不在乎Zenefits了吧。。。哈哈
对了,能问一下楼主是new ...

是的啊,不过我没有oa什么的,是两轮phone+7轮的onsite,简直累惨了
回复

使用道具 举报

🔗
cuiyang36 2015-4-16 10:31:29 | 只看该作者
全局:
我觉得这题最蛋疼的是这个:
Error cases are to be tagged in the order they appear on the list. For example, if one input pair raises both error cases 1 and 2, the output must be E1.
如果是返回任意一个错误即可的话就简单一些了。
回复

使用道具 举报

🔗
averillzheng 2015-4-16 12:53:16 | 只看该作者
全局:
这题就是吓唬吓唬人而已。很简单的。
回复

使用道具 举报

🔗
tyr034 2015-4-17 03:20:10 | 只看该作者
全局:
averillzheng 发表于 2015-4-16 12:53
这题就是吓唬吓唬人而已。很简单的。

大神指点下
回复

使用道具 举报

🔗
averillzheng 2015-4-17 09:17:53 | 只看该作者
全局:

搞个26 * 26的矩阵就可以把一切问题搞定。
回复

使用道具 举报

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

本版积分规则

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