回复: 11
收起左侧

亞麻25 Intern OA

本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0

2025(7-9月) 码农类General 本科 实习@amazon - 内推 - 在线笔试  | 😃 Positive 😐 AverageOther | 应届毕业生

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

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

x
2 OA coding question

Code Question 1
Amazon stores its data on different servers at different locations. From time to time, due to several factors, Amazon needs to move its data from one location to another. This challenge involves keeping track of the locations of Amazon's data and reporting them at the end of the year.

At the start of the year, Amazon's data was located at n different locations. Over the course of the year, Amazon's data was moved from one server to another m times. Precisely, in the iᵗʰ operation, the data was moved from movedFrom[i] to movedTo[i].
Find the locations of the data after all m moving operations. Return the locations in ascending order.

Note:

It is guaranteed that for any movement of data:
There is data at movedFrom[i].
There is no data at movedTo[i].
Example
locations = [1, 7, 6, 8]
movedFrom = [1, 7, 2]
movedTo = [2, 9, 5]

Explanation
Data begins at locations listed in locations. Over the course of the year, the data was moved three times. Data was first moved from movedFrom[0] to movedTo[0], from 1 to 2. Next, data was moved from 7 to 9, and finally, from location 2 to 5.

In the end, the locations where data is present are [5, 6, 8, 9] in ascending order.

Function Description
Complete the function getFinalLocations in the editor below.

The function is expected to return an INTEGER_ARRAY.
The function accepts the following parameters:

INTEGER_ARRAY locations
INTEGER_ARRAY movedFrom
INTEGER_ARRAY movedTo


Code Question 2
You are in the Amazon's Cloud Infrastructure Team, and you are working on a project to optimize how data flows through its network of storage servers.

You are given with n storage servers, and the throughput capacity of each server is given in an integer array named throughput.

There are pipelineCount data pipelines that need to be connected to two
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
tal transferRate, the data pipelines can optimally choose the pairs
[3, 3], [1, 3], [3, 1], [1, 1]
to obtain the maximum sum of
transferRate = (5 + 5) + (5 + 4) + (4 + 5) + (4 + 4) = 36.

Function Description
Complete the function maxTransferRate in the editor below.

maxTransferRate has the following parameters:

int throughput[n]: array of throughput provided by each server instance.
int pipelineCount: the number of data pipelines that need to be connected.
Returns

long: the maximum total transfer rate.

求大米,謝謝😊

评分

参与人数 10大米 +19 收起 理由
dreamfox0516 + 1 给你点个赞!
清道神君 + 10 欢迎分享你知道的情况,会给更多大米奖励!
BubbIeTea + 1 赞一个
suoweixibai + 1 赞一个
StudyUpUp + 1

查看全部评分


上一篇:美国花呗一轮挂
下一篇:SharkNinja + Software Automation Engineer Intern Round 2 BQ面经
Chenlu_Ru 2024-12-16 16:21:51 | 显示全部楼层
本楼:   👍  1
100%
0%
0   👎
全局:   5
83%
17%
1
请问楼主第二题过了嘛
回复

使用道具 举报

LeslieLi 2025-1-1 10:51:22 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   14
58%
42%
10
yuhangsun1014 发表于 2024-12-26 19:58
第一題全過,第二題只過一半的cases.

和我差不多,第二题我只过了八九个,后面那么大的case实在想不通怎么过
扫码关注一亩三分地求职移民公众号
更多干货内容等你发现
回复

使用道具 举报

Chenlu_Ru 2024-12-29 09:29:37 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   5
83%
17%
1
yuhangsun1014 发表于 2024-12-26 19:58
第一題全過,第二題只過一半的cases.

请问之后有收到vo嘛
回复

使用道具 举报

本楼:   👍  0
0%
0%
0   👎
全局:   11
100%
0%
0
已加米,请问work style楼主是怎么准备的
回复

使用道具 举报

 楼主| yuhangsun1014 2024-12-13 21:00:47 来自APP | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0
微信用户_5ee317d 发表于 2024-12-12 18:05:17
已加米,请问work style楼主是怎么准备的
我是讀亞麻LP準備。

评分

参与人数 1大米 +25 收起 理由
bryanjhy + 25 给你点个赞!

查看全部评分

回复

使用道具 举报

地里匿名用户
匿名用户-HMXEC  2024-12-14 02:18:09 来自APP
本楼:   👍  0
0%
0%
0   👎
請問收到vo邀請了嗎
回复

使用道具 举报

LeslieLi 2024-12-14 05:28:30 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   14
58%
42%
10
请问一下 楼主test case 全过了吗?
回复

使用道具 举报

 楼主| yuhangsun1014 2024-12-27 11:57:34 来自APP | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0
Chenlu_Ru 发表于 2024-12-16 00:21:51
请问楼主第二题过了嘛
第二題,14test cases過了7個。其他的run time error.
回复

使用道具 举报

 楼主| yuhangsun1014 2024-12-27 11:58:35 来自APP | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   0
0%
0%
0
LeslieLi 发表于 2024-12-13 13:28:30
请问一下 楼主test case 全过了吗?
第一題全過,第二題只過一半的cases.
回复

使用道具 举报

Morol 2024-12-29 13:25:55 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   37
95%
5%
2
不错呀!这个必须给一个赞!太强了。。。。。。
回复

使用道具 举报

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

本版积分规则

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