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

请教Uber onsite follow up interview

全局:

2015(10-12月) 码农类General 硕士 全职@uber - 网上海投 - Onsite  | | Other | 在职跳槽

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

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

x
两周前面了Uber onsite,今天收到HR的通知说we'd love to one last follow up interview,请问大家有没有类似的经历?求提点都会问些什
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
ile,用union find解决,和这道题类似:
4. design game:tilt maze

评分

参与人数 1大米 +30 收起 理由
woaibai + 30 感谢分享!

查看全部评分


上一篇:Mathworks电面 SDE
下一篇:求问LinkedIn 电面过了几天通知Onsite

本帖被以下淘专辑推荐:

推荐
 楼主| rebe90 2015-11-25 09:09:05 | 只看该作者
全局:
bobzhang2004 发表于 2015-11-24 18:55
楼主可以发下面经吗?

已发,攒攒人品
回复

使用道具 举报

全局:
写了下第三题java版,感觉它们加系统设计真多啊
  1. public class GroupContacts {

  2.         static class Contact {
  3.                 String name;
  4.                 List<String> emails;
  5.                 public Contact(String name, List<String> emails) {
  6.                         this.name = name;
  7.                         this.emails = emails;
  8.                 }
  9.         }

  10.         static class UnionFind {
  11.                 HashMap<Integer, Integer> father = new HashMap<Integer, Integer>();

  12.                 UnionFind(int n) {
  13.                         for (int i = 0; i < n; i++) {
  14.                                 father.put(i, i);
  15.                         }
  16.                 }

  17.                 int compressed_find(int x) {
  18.                         int parent = father.get(x);
  19.                         while (parent != father.get(parent)) {
  20.                                 parent = father.get(parent);
  21.                         }
  22.                         int tmp = -1;
  23.                         int fa = father.get(x);
  24.                         while (fa != father.get(fa)) {
  25.                                 tmp = father.get(fa);
  26.                                 father.put(fa, parent);
  27.                                 fa = tmp;
  28.                         }

  29.                         return parent;
  30.                 }

  31.                 int find(int id) {
  32.                         while (id != father.get(id)) {
  33.                                 id = father.get(id);
  34.                         }

  35.                         return id;
  36.                 }

  37.                 void union(int x, int y) {
  38.                         int fa_x = compressed_find(x);
  39.                         int fa_y = compressed_find(y);
  40.                         father.put(fa_x, fa_y);
  41.                 }
  42.         }

  43.         public static List<List<Contact>> groupContacts(Contact[] input) {
  44.                 Map<String, List<Integer>> emailRecord = new HashMap<String, List<Integer>>();

  45.                 int n = input.length;
  46.                 for (int k = 0; k < input.length; k++) {
  47.                         for (String email : input[k].emails) {
  48.                                 if (emailRecord.containsKey(email)) {
  49.                                         emailRecord.get(email).add(k);
  50.                                 } else {
  51.                                         List<Integer> list = new ArrayList<Integer>();
  52.                                         list.add(k);
  53.                                         emailRecord.put(email, list);
  54.                                 }
  55.                         }
  56.                 }
  57.                 UnionFind uf = new UnionFind(n);
  58.                 for (List<Integer> p : emailRecord.values()) {
  59.                         for (int i = 0; i < p.size() - 1; i++) {
  60.                                 uf.union(p.get(i), p.get(i + 1));
  61.                         }
  62.                 }
  63.                 Map<Integer, List<Integer>> groups = new HashMap<Integer, List<Integer>>();
  64.                 for (int i = 0; i < n; i++) {
  65.                         int parent = uf.find(i);
  66.                         if (groups.containsKey(parent)) {
  67.                                 groups.get(parent).add(i);
  68.                         } else {
  69.                                 List<Integer> list = new ArrayList<Integer>();
  70.                                 list.add(i);
  71.                                 groups.put(parent, list);
  72.                         }
  73.                 }

  74.                 List<List<Contact>> ret = new ArrayList<List<Contact>>();
  75.                 for (List<Integer> p : groups.values()) {
  76.                         List<Contact> vs = new ArrayList<Contact>();
  77.                         for (int c : p) {
  78.                                 vs.add(input[c]);
  79.                         }
  80.                         ret.add(vs);
  81.                 }
  82.                 return ret;
  83.         }
  84.        
  85.         public static void main(String[] args) {
  86.                 Contact c1 = new Contact("John", Arrays.asList("john@gmail.com"));
  87.                 Contact c2 = new Contact("Mary", Arrays.asList("mary@gmail.com"));
  88.                 Contact c3 = new Contact("John", Arrays.asList("john@yahoo.com"));
  89.                 Contact c4 = new Contact("John", Arrays.asList("john@gmail.com", "john@yahoo.com", "john@hotmail.com"));
  90.                 Contact c5 = new Contact("Bob", Arrays.asList("bob@gmail.com"));
  91.                 Contact[] input = {c1, c2, c3, c4, c5};
  92.                 List<List<Contact>> res = groupContacts(input);
  93.                 for (List<Contact> list : res) {
  94.                         for (Contact i : list) {
  95.                                 System.out.print(i.name + ":  ");
  96.                                 for (String email : i.emails) {
  97.                                         System.out.print(email + " ");
  98.                                 }
  99.                         }
  100.                         System.out.println();
  101.                 }
  102.         }
  103. }
复制代码
回复

使用道具 举报

推荐
baozijun 2016-1-17 15:23:15 | 只看该作者
全局:
并查集写的很牛!这是一个视频,分享给大家,讲得也很好。
https://www.youtube.com/watch?v=hqvV2ui29fQ

Tilt maze你怎么想的?用什么数据结构来表示maze? 应该还是DFS
https://www.mathsisfun.com/games/tilt-maze.html
回复

使用道具 举报

🔗
bobzhang2004 2015-11-25 08:55:56 | 只看该作者
全局:
楼主可以发下面经吗?
回复

使用道具 举报

🔗
温家小猫 2015-11-25 11:41:03 | 只看该作者
全局:
楼主两周之内没有任何消息吗?他们家不是一般都一两天之内给结果吗?
回复

使用道具 举报

🔗
bobzhang2004 2015-11-25 12:02:52 | 只看该作者
全局:
rebe90 发表于 2015-11-25 09:09
已发,攒攒人品

谢谢,祝楼主好运~
回复

使用道具 举报

🔗
 楼主| rebe90 2015-11-25 13:30:48 | 只看该作者
全局:
温家小猫 发表于 2015-11-24 21:41
楼主两周之内没有任何消息吗?他们家不是一般都一两天之内给结果吗?

是的~两周之内完全没有任何结果..感觉这是不是因HR而异?
回复

使用道具 举报

🔗
yyy884849 2015-11-25 13:51:32 | 只看该作者
全局:
之前有个朋友是,不过他说因为当时面的基本都是design,最后加了一轮coding的电面,不过不是很难,最后顺利拿到offer。
lz放宽心啦,问问HR面什么喽
回复

使用道具 举报

🔗
 楼主| rebe90 2015-11-25 14:13:43 | 只看该作者
全局:
yyy884849 发表于 2015-11-24 23:51
之前有个朋友是,不过他说因为当时面的基本都是design,最后加了一轮coding的电面,不过不是很难,最后顺利 ...

谢谢指点~请问你朋友加面的那轮是电面吗?
回复

使用道具 举报

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

使用道具 举报

🔗
温家小猫 2015-11-25 23:41:04 | 只看该作者
全局:
rebe90 发表于 2015-11-25 13:30
是的~两周之内完全没有任何结果..感觉这是不是因HR而异?

楼主加油啊,我周一面的,目前还没有消息。。。
回复

使用道具 举报

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

本版积分规则

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