Amazon Intern OA 2026 high-frequency real question sharing + problem solving ideas dismantling

44 Views
No Comment

I have played several games in a row recently. Amazon Intern OA, I really feel that the repetition rate of question types this year is quite high, especially this batch. The overall style is more thinking + detailed implementation than in previous years. It is not the type that can be stabilized by simply brushing LeetCode. You have to be familiar with common models, and the details must be handled steadily, otherwise it will easily capsize in the gutter. While it’s hot, I’ve sorted out a few high-frequency original questions I encountered during this period and shared them with you for your reference:

Amazon Intern OA 2026 high-frequency real question sharing + problem solving ideas dismantling

Question 1

某金融服务公司向 AWS 申请私有云网络部署。考虑到公司业务的敏感性,AWS 建议其部署特定类型的安全系统。

网络中共有NServer, no.I台服务器的安全需求由security[i]表示,每个元素代表该服务器所需的安全等级。为实现最高级别的防护,AWS 安全团队推荐在设计安全系统时遵循以下规则:

  1. 同一个安全组内的所有服务器,安全等级必须完全相同;
  2. 任意两个安全组内的服务器数量,差值不能超过 1。

Given an array of integerssecurity,请计算为保障网络安全所需的最少安全组数量。

Example

n = 6,security = [2, 3, 3, 3, 2, 1]

可按如下方式分组:

  • 组 1:安全等级 1,1 台服务器
  • 组 2:安全等级 3,3 台服务器
  • 组 3:安全等级 2,2 台服务器
  • 组 4:安全等级 2,2 台服务器最终需要 4 个安全组。

函数说明

在编辑器中完成findMinimumGroups函数:

  • 入参:int security[n]:表示各设备安全等级的整数数组
  • 出参:所需的最少安全组数量

Problem-solving ideas

To group servers of the same level, the size difference between each group must not exceed 1. Find the minimum total number of groups. Idea: First count the frequency of each level, and then traverse the possible group capacity k. Determine whether each frequency can be broken down into several groups with a capacity of k or k+1. If feasible, add up the number of groups and record the minimum.

Question 2

你是某汽车制造公司的物流经理,负责将货物存储在安全仓库中。

给定长度为NArray ofdeliveryLogs,其中第I个元素代表第I条物流记录中的零件数量;同时给定一个偶数K,代表可用的安全仓库数量。

存储货物时需遵循以下规则:

  1. 每个仓库只能存储来自同一条物流记录的货物,不同记录的货物不能混存;但同一条记录的货物可以拆分到多个仓库中。
  2. 存储完成后,货物数量最多的 k/2 个仓库会被入侵。
  3. 剩余的 k/2 个仓库是安全的,只有这些仓库中的货物会被计入安全库存。

你的任务是:计算可存储的最大安全货物数量。

Example

N=4

deliveryLogs = [3, 5, 9, 6]

k = 4

如果将每条记录的货物单独存入一个仓库,各仓库货物数为[3, 5, 9, 6]。此时货物最多的 2 个仓库(9 和 6)会被入侵,安全库存为3+5=8.

Problem-solving ideas

Allocate n types of logs to k warehouses, and each warehouse is limited to one type of logs. The system will eliminate the largest k/2 warehouses and retain the smallest k/2 warehouses. The goal is to maximize the total quantity of goods reserved in the warehouse. Idea: Adopt an even distribution strategy to prevent a single warehouse from being eliminated if it is too large. Enumerate the target value x through the dichotomy method to verify whether at least k/2 warehouses with a volume of x can be split, thereby maximizing the total amount of inventory.

Question 3

在亚马逊仓库机器人系统中,多台机器人同时运行以高效运输包裹。每台机器人有两种状态:待机(Standby)或运行(Operating)。

为实现顺畅协调,每台机器人I有预设的协调阈值coordinationThreshold[i],该阈值决定了机器人故障的条件:

  1. 若机器人I处于运行状态,但其他处于运行状态的机器人总数小于coordinationThreshold[i],则机器人I故障;
  2. 若机器人I处于待机状态,但处于运行状态的机器人总数大于等于coordinationThreshold[i],则机器人I故障。

如果任意一台机器人故障,系统将被视为不稳定。请返回无机器人故障的有效配置总数(配置指为每台机器人分配运行 / 待机状态的方案,两个配置不同当且仅当至少一台机器人状态不同)。

Example

n = 8

coordinationThreshold = [6, 0, 3, 3, 6, 7, 2, 7]

共有 3 种有效运行状态选择方案(0 基索引):

  1. 仅索引 1 的机器人处于运行状态
  2. 仅索引 2、3 的机器人处于运行状态
  3. 仅索引 6 的机器人处于运行状态

Problem-solving ideas

The essence is to find how many types of running robots the number O can make the system stable. Let the total number of runs be O. To be legal, the threshold Ti of no robot must be equal to O, otherwise the robot will malfunction no matter what state it is in; the number of robots whose threshold is less than O must be exactly equal to O. Use counting sorting to count the threshold frequency and just iterate through the statistical quantity.

题目 4

亚马逊新开了一个仓库,初始库存为 0。仓库将接受N天的检查,经理每天需要执行一项任务,第I天的任务由数组tasks[i]Express.

每天傍晚,会发生以下三种情况之一:

  • astasks[i] > 0:向仓库运送tasks[i]件产品,库存增加tasks[i];
  • astasks[i] < 0:从仓库发出|tasks[i]|件产品,库存减少|tasks[i]|;若库存不足,经理会借入产品,库存变为负数;
  • astasks[i] = 0:亚马逊检查员会检查仓库。若此时库存为负数,检查员会发出通知关闭仓库。

每天早上,经理可以通过紧急补货,向仓库增加任意数量的产品(经理提前知晓所有任务详情)。

经理的目标是:

  1. 确保每次检查(tasks[i]=0时)仓库库存不为负数;
  2. 仓库库存始终不超过max_products(仓库最大容量);
  3. 计算为满足上述条件,最少需要紧急补货的总产品数量。

Problem-solving ideas

Use the sum of greedy and prefixes to preprocess the maximum inventory of the suffix, lock the future safe purchase space, and trigger replenishment when the inventory is negative during the traversal. The greedy strategy is to press the maximum limit that will not cause liquidation in the future to fill up the purchase amount every time. If the limit value still does not fill the gap, there is no solution, otherwise the number of purchase days will be increased by one.

More help with Amazon Intern OA

If you are also preparing for Amazon Intern OA, especially the 2026 batch, it is recommended to focus on thoroughly understanding these types of models instead of blindly refreshing questions. Students who need this set of Amazon 2026 Intern high-frequency OA problem solutions + detailed codes can directlyPrivate message meOA」to receive.

Also, if you are pressed for time during the OA stage, are stuck on a certain question, or want to significantly improve your passing rate, you can also ask us for help. Our team can provide real-time idea guidance, code optimization, mock interviews, and full-process auxiliary services from OA to VO. Many students have successfully passed Amazon OA with our help and successfully entered the next round.

Prepare early, get OA passed early, and enter the interview session early~

END
 0