查看: 2901| 回复: 3
跳转到指定楼层
上一主题 下一主题
收起左侧

[找工就业] Microsoft 巨硬 OA 2021 summer sde intern

全局:

2021(1-3月)-CS本科+短暂实习或全职不超过3个月 | 内推| 码农类General实习@microsoft

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

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

x
1月底内推了巨硬,不是说内推的没有OA直接面试吗,我裂开了。
两小时三题A了两题,估计凉凉。

第一题:AC
In one setp, any element of a given array can be either increased or decreased by 1, what is the minimum steps to take that can make all elements in the array equal
Input: [3, 1, 2, 2]
Output: 2. ----
解释:[3, 1, 2, 2] -> [3 - 1, 1, 2, 2] -> [2, 1+1, 2, 2] = [2, 2, 2, 2]
解法:
count = 0
sort array
find medium
for ...
    count += abs(medium - array[i]). 1point3acres.com
return count

第二题:AC
给了一个binary tree,找出一个maximum length path,path必须包含root并不能有重复value
解法:.1point3acres
就DFS with memory
path = set()
path.add(root)
stack = [(node, path)]
max_len = 0
while stack:
    node, path = stack.pop()
    max_len = max(max_len, len(path))
    if node.left and node.left not in path: ...
    if node.right ..... 1point 3 acres
return max_len. From 1point 3acres bbs

第三题: 爆炸,他给的三个test case过了,剩下的全挂了 ..
find such a path whose product contains the maximum possible number of trailing zeros, path可以转向一次
Input:    [[10, 100, 10],
               [1, 10, 1],
               [1, 10, 1]]
Output: 5
解释:10 * 100 * 10 * 10 有五个0.--
解法:用recursive,加判断
maxZeros(map, i + 1, j, product * mat[i][j], turned, direction)
...
...
...
max_trailing_zero = max(max_trailing_zero, count_zeros(product))

评分

参与人数 3大米 +5 收起 理由
lyft + 3 给你点个赞!
RRRaymonddd + 1 给你点个赞!
carrotdad + 1 赞一个

查看全部评分


上一篇:有人也在面Uber DA intern吗
下一篇:orcale已经发offer是否应该继续等别的公司
🔗
MindTheGap 2021-2-26 23:34:55 | 只看该作者
全局:
楼主你好,请问这是微软中国的oa嘛?
如果是的话,本场好多人链接都失效没登进去
. 1point3acres.com
回复

使用道具 举报

🔗
 楼主| cocowine 2021-2-26 23:46:29 | 只看该作者
全局:
MindTheGap 发表于 2021-2-26 23:34
楼主你好,请问这是微软中国的oa嘛?
如果是的话,本场好多人链接都失效没登进去

对的微软中国,我也收到很多人失效的邮件了

评分

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

查看全部评分

回复

使用道具 举报

全局:
今年无论投递来源如何,都要有笔试了(年前的提前批除外,已经有好些 offer 发出来了)。
回复

使用道具 举报

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

本版积分规则

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