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

Uber 电面+onsite

全局:

2017(7-9月) 码农类General 本科 全职@uber - 内推 - 技术电面 Onsite  | | Fail | 在职跳槽

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

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

x
电面是 insert_into_cycle_linked_list.html:

onsite:
1. 给出 [“1999-02-13”, “2001-03-14"] 打印出中间所有的月份 [“1999-02-13”, “1999-02-28"],[“1999-03-01”, “1999-03-31"] ...  [
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
果按城市存储,查询的坐标正好落在城市边缘就要去另外一个数据库查询。如果DB存一些周围城市stop 的duplication, consistence 就成了问题。请高手指点如何存储stop 的信息并且方便按cutomer的位置进行快速的查询。

上一篇:pocket gems 电面1
下一篇:哎妈今天是挂了Google店面

本帖被以下淘专辑推荐:

  • · uber|主题: 31, 订阅: 3
  • · Uber ATG|主题: 45, 订阅: 2
推荐
luobo 2017-7-29 14:31:18 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

全局:
试着写了下第一题(没重构过,写的比较丑)。。。
  1. vector<pair<string, string> > getSpan(const string& start, const string& end) {
  2.   int i = 0;
  3.   int year_start;
  4.   int month_start;
  5.   int day_start;
  6.   int year_end;
  7.   int month_end;
  8.   int day_end;
  9.   int j = 0;
  10.   
  11.   while (j < start.size() && start[j] != '-')
  12.     ++j;
  13.   year_start = stoi(start.substr(i, j - i));
  14.   ++j;
  15.   i = j;
  16.   while (j < start.size() && start[j] != '-')
  17.     ++j;
  18.   month_start = stoi(start.substr(i, j - i));
  19.   ++j;
  20.   i = j;
  21.   while (j < start.size() && start[j] != '-')
  22.     ++j;
  23.   day_start = stoi(start.substr(i, j - i));
  24.   i = 0;
  25.   j = 0;
  26.   while (j < end.size() && end[j] != '-')
  27.     ++j;
  28.   year_end = stoi(end.substr(i, j - i));
  29.   ++j;
  30.   i = j;
  31.   while (j < end.size() && end[j] != '-')
  32.     ++j;
  33.   month_end = stoi(end.substr(i, j - i));
  34.   ++j;
  35.   i = j;
  36.   while (j < end.size() && end[j] != '-')
  37.     ++j;
  38.   day_end = stoi(end.substr(i, j - i));
  39.   
  40.   if (year_start == year_end && month_start == month_end)
  41.     return {{start, end}};

  42.   int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

  43.   int year = year_start;
  44.   int month = month_start + 1;
  45.   vector<pair<string, string> > res;
  46.   res.push_back({
  47.       start,
  48.         to_string(year_start) + "-" + to_string(month_start) + "-" +
  49.         to_string(days[month_start - 1] + (month_start == 2 && (year_start % 400 == 0 || (year_start % 100 != 0 && year_start % 4 == 0))))
  50.         });
  51.   while (year != year_end || month != month_end) {
  52.     res.push_back({
  53.         to_string(year) + "-" + to_string(month) + "-1",
  54.           to_string(year) + "-" + to_string(month) + "-" + to_string(days[month - 1] + (month == 2 && (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))))
  55.       });
  56.     year = year + month / 12;
  57.     month = month % 12 + 1;
  58.   }
  59.   res.push_back({to_string(year_end) + "-" + to_string(month_end) + "-1", end});
  60.   return res;
  61. }
复制代码
回复

使用道具 举报

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

使用道具 举报

🔗
jingshihao 2017-7-28 22:48:35 | 只看该作者
全局:
感觉system design好像很难的样子,请问楼主如果是new grad会考这么难的system design吗?
回复

使用道具 举报

🔗
 楼主| ThinkDeeper2 2017-7-29 07:05:36 | 只看该作者
全局:
第一题应该用 import java.time.LocalDate;
回复

使用道具 举报

🔗
风华义气 2017-7-29 09:02:39 | 只看该作者
全局:
为啥感觉面试的时候好难啊
回复

使用道具 举报

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

使用道具 举报

🔗
sterne 2017-7-30 12:48:29 | 只看该作者
全局:
请问楼主面的哪个组?感觉偏难
回复

使用道具 举报

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

使用道具 举报

🔗
endofunctor 2017-7-30 14:33:20 | 只看该作者
全局:
最后一题可以用Geohashing存stop + quad tree存地形吗?render的时候同时读stop geolocation和地形。
一个想法不一定对
回复

使用道具 举报

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

本版积分规则

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