📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 9
跳转到指定楼层
上一主题 下一主题
收起左侧

Uber phone + onsite跪经

全局:

2017(1-3月) 码农类General 硕士 全职@uber - 内推 - Onsite  | | Fail | 应届毕业生

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

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

x
先说phone吧。印度小哥。我人在国内过年,早上5点爬起来翻墙用google hangout跟他聊,结果没有声音,换whatsap也不好使,接着换skype。这个蠢skype居然不能实时notification,最后折腾了15分钟才说上话。因为时间紧直接做题,题目是这样的:
input: a very long string as a message to send to user, the string length limit of a single message
output: array of messages fo
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
没搞清楚这题想干嘛。他也没说input output是这种奇怪的树,我当是string写了一会他才告诉我。然而并不会写,他是想提示我的,然后他表达出来的提示并没有帮到我。最后时间太紧,只写出了个大概,还是不能run,当时就欲哭无泪了。

面成这样应该是无缘了。希望对大家有帮助。总体来说,uber面试是不按常理出牌的,特别重视communications,准备的时候多注意这方面走走心。

评分

参与人数 3大米 +36 收起 理由
李大牛 + 3 感谢分享!
zzwcsong + 30
ginues109 + 3 很有用的信息!

查看全部评分


上一篇:纯粹存储一面多线程挂经(附代码)
下一篇:Yelp今日电面
🔗
ginues109 2017-2-17 03:11:55 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

全局:
第五轮能不能先根据input树  转会String expression  然后再转回树状表达式?
回复

使用道具 举报

🔗
hwu2498 2017-2-20 06:08:44 | 只看该作者
全局:
第五题有可能同一个output有多种答案啊,感觉这题还是蛮难的
回复

使用道具 举报

🔗
 楼主| ychen622 2017-2-20 06:34:32 | 只看该作者
全局:
当时我是写的recursion,base case是非ops,然后+-*/分开讨论。不过我也没全写出来,谁写出来了po上来大家看看
回复

使用道具 举报

🔗
Emerson_Ding 2017-2-20 07:06:00 | 只看该作者
全局:
和ls想法差不多..转成string, recursion处理,再转成tree. 不过树的形状可能和lz给的例子不一样
回复

使用道具 举报

🔗
mingruiyrh 2017-3-5 01:45:19 | 只看该作者
全局:
楼主等了多久收到onsite的结果的呢?
回复

使用道具 举报

🔗
invinsibility 2017-3-15 22:57:15 | 只看该作者
全局:
求第五题思路????感觉直接用tree recursion要分很多种情况讨论。
回复

使用道具 举报

🔗
gegeyongfu 2017-3-15 23:39:58 | 只看该作者
全局:
求问楼主推的哪个职位啊?谢啦谢啦
回复

使用道具 举报

🔗
chaohubian 2017-9-12 05:00:09 | 只看该作者
全局:
  1. class Solution {
  2. public:
  3.     class TreeNode {
  4.     public:
  5.         char val;
  6.         vector<TreeNode*> children;
  7.         TreeNode(char val) {
  8.             this->val=val;
  9.             this->children={};
  10.         }
  11.     };
  12.    
  13.     TreeNode* buildTree(TreeNode* root) {
  14.         if (root==NULL) {
  15.             return NULL;
  16.         }
  17.         else if (root->val=='*') {
  18.             vector<TreeNode*> lefts;
  19.             vector<TreeNode*> rights;
  20.             if (root->children[0]->val=='+') {
  21.                 lefts=getChildren(root->children[0]);
  22.             }
  23.             if (root->children[1]->val=='+') {
  24.                 rights=getChildren(root->children[1]);
  25.             }
  26.             if (lefts.size()>0 && rights.size()>0) {
  27.                 TreeNode* result=new TreeNode('+');
  28.                 for (int i=0; i<lefts.size(); i++) {
  29.                     for (int j=0; j<rights.size(); j++) {
  30.                         TreeNode* child = new TreeNode('*');
  31.                         TreeNode* child1 = new TreeNode(lefts[i]->val);
  32.                         TreeNode* child2 = new TreeNode(rights[j]->val);
  33.                         child->children.push_back(child1);
  34.                         child->children.push_back(child2);
  35.                         result->children.push_back(child);
  36.                     }
  37.                 }
  38.                 return result;
  39.             }
  40.             else if (lefts.size()>0) {
  41.                 TreeNode* result=new TreeNode('+');
  42.                 for (int i=0; i<lefts.size(); i++) {
  43.                     TreeNode* child = new TreeNode('*');
  44.                     TreeNode* child1 = new TreeNode(lefts[i]->val);
  45.                     TreeNode* child2 = new TreeNode(root->children[1]->val);
  46.                     child->children.push_back(child1);
  47.                     child->children.push_back(child2);
  48.                     result->children.push_back(child);
  49.                 }
  50.                 return result;
  51.             }
  52.             else if (rights.size()>0) {
  53.                 TreeNode* result=new TreeNode('+');
  54.                 for (int i=0; i<rights.size(); i++) {
  55.                     TreeNode* child = new TreeNode('*');
  56.                     TreeNode* child1 = new TreeNode(root->children[1]->val);
  57.                     TreeNode* child2 = new TreeNode(rights[i]->val);
  58.                     child->children.push_back(child1);
  59.                     child->children.push_back(child2);
  60.                     result->children.push_back(child);
  61.                 }
  62.                 return result;
  63.             }
  64.             else {
  65.                 return root;
  66.             }
  67.         }
  68.         else {
  69.             return root;
  70.         }
  71.     }
  72.    
  73.     vector<TreeNode*> getChildren(TreeNode* root) {
  74.         vector<TreeNode*> result;
  75.         if (root->val=='+' || root->val=='*') {
  76.             for (int i=0; i<root->children.size(); i++) {
  77.                 result.push_back(root->children[i]);
  78.             }
  79.         }
  80.         return result;
  81.     }
  82.     void test() {
  83. //                    +
  84. //                *       d
  85. //              *    e
  86. //           +      c
  87. //         a   b
  88.         string str="((a+b)*(c+d))*e+d";
  89.         TreeNode* t1=new TreeNode('*');
  90.         TreeNode* t2=new TreeNode('+');
  91.         TreeNode* t3=new TreeNode('+');
  92.         TreeNode* t4=new TreeNode('a');
  93.         TreeNode* t5=new TreeNode('b');
  94.         TreeNode* t6=new TreeNode('c');
  95.         TreeNode* t7=new TreeNode('d');
  96.         t1->children.push_back(t2);
  97.         t1->children.push_back(t3);
  98.         t2->children.push_back(t4);
  99.         t2->children.push_back(t5);
  100.         t3->children.push_back(t6);
  101.         t3->children.push_back(t7);
  102.         TreeNode* root=buildTree(t1);
  103.         cout<<root->val<<endl;
  104.     }
  105. };
  106. 这是一个简单的版本,可以根据followup扩展到通用情况
复制代码

评分

参与人数 1大米 +5 收起 理由
nicezg + 5 给你点个赞!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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