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

[实习] Amazon sde1 OA 2026 intern

全局:

2026(4-6月)-CS硕士+3个月-1年 | Other| 码农类General实习@amazon

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

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

x
coding(70min) + work style (不限时,有推荐时间), 有demo link 可以提前多次练习熟悉hankrank的考试环境

1:Maximum System Memory Capacity
Given n servers where the memory capacity of the i-th server is represented by memory[i]. A system always contains an even number of servers. If the system has 2x servers, then x of them will be primary servers and the other x will be backup servers. For each primary server P, there exists a backup server B where memory >= memory[P]. The system's memory capacity is the sum of the memory capacities of all primary servers. Given n servers and an array memory, find the maximum system memory capacity that can be formed using the n servers.
. check 1point3acres for more.
x 个 primary server, x 个 backup server
总能在 backup servers 中找一个server  j power[j] > 任意在一个primary servers 中的 i  power[i]
..
思路: 排序(从小到大),两两组合 比如 abcdef (a, b), (c, d) (e, f)     a, c, e 在primary, b, d, f 在backup

[b]2:Minimum Sum to Make Array Non-Decreasing

A set of n servers are used for horizontally scaling an application. The goal is to have the computational power of the servers in non-decreasing order. To do so, you can increase the computational power of each server in any contiguous segment by x. Choose the values of x such that after the computational powers are in non-decreasing order, the sum of the x values is minimum.
Example: n = 5, power = [3, 4, 1, 6, 2]. Add 3 units to subarray (2,4) and 4 units to subarray (4,4). Final arrangement: [3, 4, 4, 9, 9]. Answer is 3 + 4 = 7..1point3acres

思路: 找power中的所有下降处, 结果就是 所有下降处的|差值| 之和

走过路过求加米!加米不会扣除自己的大米,希望能攒点积分看帖,谢谢大家!祝大家都拿到心仪的Offer!

评分

参与人数 2大米 +4 收起 理由
匿名用户-UINIW + 3 赞一个
ccczy + 1 给你点个赞!

查看全部评分


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

本版积分规则

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