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

报个Uber的offer,还有一些不成熟的小心得

 
🔗
xiaozhuxiaozhu 2016-11-28 11:28:49 | 只看该作者
全局:
samuelling 发表于 2016-11-28 11:25
不招了吧,当时11月初hr给我发offer的时候,还特别说希望我去西雅图,说sf没有地儿了

感谢分享,你这个用户组 是会员么
回复

使用道具 举报

🔗
tj474474 2016-11-29 05:31:29 | 只看该作者
全局:
楼主请问您第三轮是用java面的吗? 因为input如果是String的话我发现自动就会把escape的情况考虑进去了。 例如: "\\" 对java来说就是'\' "\"" 就是 '"' "\n" 就是一个换行的char 这样子的话这个题目等于只是考虑有没有pending的quote而已,难度好像降低不少啊。
回复

使用道具 举报

🔗
liurudahai 2016-11-30 09:56:06 | 只看该作者
全局:
求问第二题怎么用TRIE解,没看明白
回复

使用道具 举报

🔗
timpark4 2016-12-12 07:51:57 | 只看该作者
全局:
请问lz 接offer了吗?
回复

使用道具 举报

🔗
luofeidream 2016-12-12 08:34:06 | 只看该作者
全局:
leixiang5 发表于 2016-11-17 10:57
uber怎么可能小包。。。

去抖包袱看了一眼,给new grad的包确实低。。。
回复

使用道具 举报

全局:
还是因为楼主是个性格好的妹子!不是每个妹子都有光环哒,楼主棒!
回复

使用道具 举报

全局:
lz linkedin头像很好看吧。。
回复

使用道具 举报

全局:
关注一波楼主,顺便求一下明年的内退!
回复

使用道具 举报

全局:
恭喜楼主啊,准备uber电面了,沾一下楼主的喜气!
回复

使用道具 举报

🔗
发面经喽 2017-2-4 03:14:20 | 只看该作者
全局:
恭喜lz啊,下周面求人品~
根据lz的提示把第二题写了一下,有问题欢迎指出
另外第三题不是很懂啊,lz说按照逗号和双引号隔开,但是逗号的部分也没有隔开啊看结果的话。而且双引号可以嵌套吗?求问lz都有什么样的corner case啊。。非常感谢
  1. public class LongestSubDomain {
  2.     private class TrieNode {
  3.         String str;
  4.         Map<String, TrieNode> map;
  5.         boolean isLeaf;
  6.         public TrieNode(String str) {
  7.             this.str = str;
  8.             this.map = new HashMap<>();
  9.             this.isLeaf = false;
  10.         }
  11.     }
  12.     TrieNode root = new TrieNode("#");
  13.     public static void main(String[] args) {
  14.         LongestSubDomain lsd = new LongestSubDomain();
  15.         String[] domains = {".com", ".cn", ".service.com", ".net", ".youku.net"};
  16.         String url = "yeah.hello.youku.net";
  17.         for (String str : domains) {
  18.             lsd.insert(str);
  19.         }
  20.         String res = lsd.startWith(url);
  21.         System.out.println(res);
  22.     }
  23.     public void insert(String domain) {
  24.         String[] temp = domain.split("\\.");
  25.         TrieNode node = root;
  26.         for (int i = temp.length - 1; i >= 0; i--) {
  27.             if (temp[i].length() == 0) continue;
  28.             if (node.map.containsKey(temp[i])) {
  29.                 node = node.map.get(temp[i]);
  30.             } else {
  31.                 TrieNode newNode = new TrieNode(temp[i]);
  32.                 node.map.put(temp[i], newNode);
  33.                 node = newNode;
  34.             }
  35.         }
  36.         node.isLeaf = true;
  37.     }
  38.     public String startWith(String url) {
  39.         String[] temp = url.split("\\.");
  40.         TrieNode node = root;
  41.         String res = "";
  42.         int index = temp.length - 1;
  43.         for (int i = temp.length - 1; i >= 0; i--) {
  44.             if (temp[i].length() == 0) continue;
  45.             if (node.map.containsKey(temp[i])) {
  46.                 res = "." + temp[i] + res;
  47.                 node = node.map.get(temp[i]);
  48.             } else {
  49.                 if (!node.isLeaf) {
  50.                     res = "";
  51.                 } else {
  52.                     index = i;
  53.                 }
  54.                 break;
  55.             }
  56.         }
  57.         return temp[index] + res;
  58.     }
  59. }
复制代码
回复

使用道具 举报

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

本版积分规则

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