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

Google VO + timeline

🔗
匿名用户-2YK4U  2021-12-17 11:30:13 |倒序浏览

2021(10-12月) 码农类General 硕士 全职@google - 猎头 - Onsite  | 😐 Neutral 😐 Average | Pass | 在职跳槽

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

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

x
本帖最后由 匿名 于 2021-12-16 22:32 编辑

您好!
本帖隐藏的内容需要积分高于 175 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 175 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies


Timeline:
10月初recruiter电话直撩
跳过店面约好11/15 onsite
12/02电话通知过HC
12/16 team match完


求大米

评分

参与人数 7大米 +16 收起 理由
gaussun123 + 1 很有用的信息!
14417335 + 1 给你点个赞!
bryanjhy + 5 给你点个赞!
tsamano110 + 1 求2,5轮思路!谢谢
avazhr + 1 很有用的信息!

查看全部评分


上一篇:丢盒子前端面经
下一篇:亚麻intern oa1 新鲜挂经
地里匿名用户
推荐
匿名用户-0M8NL  2021-12-20 09:34:58
zhang123587 发表于 2021-12-19 17:25
比较 interval 的时候,可以先按 startTime 排序,找到距离 interval 最近的不相交的 interval[j] ,然后 ...

  1. '''
  2. assume intervals must contain at least one element
  3. '''

  4. from typing import List
  5. import bisect
  6. class shortestTwoSubarray:
  7.     # if no negative, find all intervals sum to k in O(n)
  8.     # both end of intervals will be inclusive
  9.     # the returned intervals list should be in a sorted order (sorted by start)
  10.     def all_intervals_sum_k(self, xs: List[int], k: int) -> List[List[int]]:
  11.         start, acc, res = 0, 0, []
  12.         for i, x in enumerate(xs):
  13.             acc += x
  14.             while start <= i and acc >= k:
  15.                 if acc == k and start < i:
  16.                     res.append([start, i])
  17.                 acc -= xs[start]
  18.                 start += 1
  19.         return res
  20.         
  21.     # if negative, find all intervals sum to k in O(n^2)
  22.     # both end of intervals will be inclusive
  23.     # the returned intervals list should be in a sorted order (sorted by start)
  24.     def all_intervals_sum_k_with_negative(self, xs: List[int], k: int) -> List[List[int]]:
  25.         n, res = len(xs), []
  26.         for start in range(n):
  27.             acc = 0
  28.             for end in range(start, n):
  29.                 acc += xs[end]
  30.                 if acc == k:
  31.                     res.append([start, end])
  32.         return res
  33.    
  34.     # from all intervals sums up to k, find the two shortest
  35.     # O(nlog(n)), n is the number of intervals sums up to k
  36.     def two_shortest_intervals(self, xs: List[int], k: int) -> List[List[int]]:
  37.         intervals = self.all_intervals_sum_k(xs, k)
  38.         if len(intervals) < 2:
  39.             return []
  40.         def length(interval):
  41.             return interval[1]-interval[0]+1
  42.         n = len(intervals)
  43.         right_side_shortest = [float('inf')]*n
  44.         # the shortest intervals length of subarray intervals[i:], O(n)
  45.         right_side_shortest[-1] = length(intervals[-1])
  46.         for i in range(n-2, -1, -1):
  47.             right_side_shortest[i] = min(right_side_shortest[i+1], length(intervals[i]))
  48.         print(right_side_shortest)
  49.         # use binary search to find the right most non-overlapping index idx,
  50.         # as well as the shortest interval length of subarray intervals[idx:]
  51.         # O(nlog(n))
  52.         res = float('inf')
  53.         for i, [start, end] in enumerate(intervals):
  54.             idx = bisect.bisect_left(intervals, [end, float('-inf')], i+1, n)
  55.             if idx == n:
  56.                 continue
  57.             res = min(length(intervals[i])+right_side_shortest[idx], res)
  58.         return res
  59.    
  60. s = shortestTwoSubarray()
  61. arr = [1, 5, 7, 1, 2, 3, 5, 3, 3, 1, 1, 4]
  62. k = 6
  63. actual = s.two_shortest_intervals(arr, k)
  64. assert actual==4, f"first test failed with answer == {actual}"
  65.         
复制代码
是挺烦的,不知道有没有更简洁、复杂度更好的方法。好奇楼主怎么做的。
回复

使用道具 举报

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

使用道具 举报

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

使用道具 举报

🔗
pengzhao0524 2021-12-17 12:04:59 | 只看该作者
全局:
请问我刚刚定了面试的时间,可是时间表上没有每一轮是考什么,都是这样的吗?

我是做图像的,电话面试的时候,面试官和我聊了不少图像的知识。VO的时候会考专业知识吗? 谢谢!
回复

使用道具 举报

🔗
lande 2021-12-17 12:10:40 来自APP | 只看该作者
全局:
pengzhao0524 发表于 2021-12-16 20:04:59
请问我刚刚定了面试的时间,可是时间表上没有每一轮是考什么,都是这样的吗?

我是做图像的,电话面试的时候,面试官和我聊了不少图像的知识。VO的时候会考专业知识吗? 谢谢!
不知道诶…我是面的码农岗位,4轮coding+1轮BQ

评分

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

查看全部评分

回复

使用道具 举报

🔗
emilys 2021-12-18 06:59:08 | 只看该作者
全局:
第4题怎么做?先扫一遍找到所有intervals with sum = k, O(n)。然后再每两个interval比较一下,看有没有overlap,找到最小element intervals,O(m^2)?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-G3HJ1  2021-12-18 09:46:19
emilys 发表于 2021-12-17 14:59
第4题怎么做?先扫一遍找到所有intervals with sum = k, O(n)。然后再每两个interval比较一下,看有没有ove ...

有点点像410,但不是
回复

使用道具 举报

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

使用道具 举报

地里匿名用户
🔗
匿名用户-0M8NL  2021-12-20 09:10:27
emilys 发表于 2021-12-17 16:59
第4题怎么做?先扫一遍找到所有intervals with sum = k, O(n)。然后再每两个interval比较一下,看有没有ove ...

有负数的话怎么O(n)求所有intervals啊…
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-G3HJ1  2021-12-21 03:19:54
匿名者 发表于 2021-12-19 17:34
是挺烦的,不知道有没有更简洁、复杂度更好的方法。好奇楼主怎么做的。

第四题其实是subarray吧?不是interval
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-2YK4U  2021-12-21 03:30:51
emilys 发表于 2021-12-17 17:59
第4题怎么做?先扫一遍找到所有intervals with sum = k, O(n)。然后再每两个interval比较一下,看有没有ove ...

我也是这么做的
回复

使用道具 举报

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

本版积分规则

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