Amazon OA HackerRank April Questions Release | Analysis of Latest Question Types and高频考点 (Frequent Exam Topics) in Detail (2026 Edition)

35 Views
No Comment

Latest in April Amazon OA with Amazon clearly adding more types of questions that require on-site observation and deduction compared to last year. Memorizing templates alone is no longer sufficient to score full marks. As always, this will come with a standard set: Amazon OA (platform), 2 coding questions + about 70 minutes (with some roles potentially having Work Simulation). I've compiled the most frequently appearing true questions from April and provided them for quick preparation.

Amazon OA HackerRank April Questions Release | Analysis of Latest Question Types and高频考点 (Frequent Exam Topics) in Detail (2026 Edition)

April Amazon OA Overall Configuration (Latest)

Platform: HackerRank
Number of questions: 2 questions
Duration: 70 minutes (some sessions are 60 minutes)

Common Combinations:

  • Mindset While Traveling (Narrowly Cognitive)
  • Note: There are virtually no pure simple questions.

Note: There are hardly any pure simple questions.

Minimum number of security groups

Title

一家金融服务公司向 AWS 请求部署其私有云网络。考虑到公司业务的敏感性,AWS 还建议他们添加一种特定类型的安全系统。

网络中共有 N Server, no. I 台服务器的安全需求由 security[i] 表示,其中每个元素代表该服务器的安全防护等级。

为了确保最高级别的防护,AWS 安全团队在设计安全系统时遵循以下规则:

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

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

Example

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

分组方案如下:

  • 等级 1:1 台服务器 → 1 个组
  • 等级 2:2 台服务器 → 1 个组
  • 等级 3:3 台服务器 → 2 个组(每组 1-2 台,差值≤1)最终需要 4 个组。

Function requirements

Completion function findMinimumGroups(security),输入为整数数组 security,返回最少需要的安全组数量(整数)。

Ideas

Determine the frequency for each level and enumerate the base group size \( S \) from its minimum value. If all frequencies can be composed of \( S \) and \( S+1 \), add to the count.

最大安全库存总量

Title

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

Given a length of N Array of deliveryLogs,其中第 I 个元素代表第 I 批货物的零件数量;同时给定一个偶数 K,代表可用的安全仓库数量。

货物存储规则如下:

  1. 每个仓库只能存储来自同一批货物的零件,不同批次的货物不能混存;同一批货物的零件可以拆分到多个仓库。
  2. 存储完成后,货物数量最多的 k/2 个仓库会被入侵,无法计入安全库存。
  3. 剩余的 k/2 个仓库是安全的,只有这些仓库里的货物会被计入安全库存。

你的任务是:计算最大可实现的安全库存总量。

Example

Enter:N=4,deliveryLogs = [3, 5, 9, 6],k = 4

如果将每批货物单独存入一个仓库,仓库库存为 [3,5,9,6]None The text "。" is an empty placeholder and does not contain any meaningful content to translate. Please provide a proper sentence or phrase for translation.

此时货物最多的 2 个仓库(9、6)被入侵,剩余安全库存为 3+5=8None The text "。" is an empty placeholder and does not contain any meaningful content to translate. Please provide a proper sentence or phrase for translation.

(最优方案可得到更高的安全库存,需通过拆分批次实现)

Function requirements

Completion function secureMaximumDeliveries(deliveryLogs, k),输入为整数数组 deliveryLogs And integers K,返回最大安全库存总量(整数)。

Ideas

Utilizing a greedy strategy, by enumerating possible median water levels X, calculate the number of blocks of capacity X that each record can be divided into and the remainder. Take the sum of the largest k blocks, denoted as S, to maximize the value of S - (k/2)*X.

虚拟机租赁总收益

Title

在 Amazon EC2 中,共有 N 种虚拟机(VM)类型,每种类型有一定数量的可用实例。

每次租赁一个 VM 实例时,客户需要支付的费用等于:

所有 VM 类型中最小的非零可用数量 + 所有 VM 类型中最大的可用数量

共有 M 个客户依次前来租赁。每个客户始终选择当前可用数量最多的 VM 类型进行租赁;租赁后,该 VM 类型的可用数量减 1。

请计算完成所有租赁请求后,累计获得的总收益。

Example

Enter:N=3,vmStock = [0, 2, 4],m = 4

模拟租赁过程:

Sheet

客户 选择的 VM 类型 费用(最小非零 + 最大) 租赁后剩余库存
初始 [0, 2, 4]
1 3 号(4 个) 2 + 4 = 5 [0, 2, 3]
2 3 号(3 个) 2 + 3 = 4 [0, 2, 2]
3 2 号 / 3 号(2 个) 2 + 2 = 3 [0, 1, 2]
4 3 号(2 个) 1 + 2 = 3 [0, 1, 1]

总收益:5 + 4 + 3 + 3 = 15,因此答案为 15。

Function requirements

完成对应函数,输入为 VM 库存数组 vmStock 和客户数 M,返回总收益(整数)。

Ideas

Maintain inventory and frequency in an ordered structure. Each iteration, add together the inventory for the smallest key and the largest key. Decrease the inventory of the largest key by one; if it reaches zero, delete it. Repeat this process m times.

包裹标签最大拆分份数

Topic

亚马逊的一个团队需要确保所有包裹按标签正确排序。每个包裹的标签是一个大写英文字母,所有标签组成字符串 packages,其中第 I 个字符代表第 I 个包裹的标签。

为了优化排序流程,团队需要分析字符串的每个前缀(长度从 1 到 n),计算该前缀最多能被拆分为多少个相等的部分,拆分需满足:

  • 每个部分中,每个字符的出现次数,必须与其他所有部分完全相同。

given string packages,请对每个前缀长度 T(1 ≤ t ≤ n),计算该前缀满足条件的最大拆分份数。

Example

Enter:packages = "ABAB"

各前缀的计算结果如下:

Sheet

前缀长度 前缀字符串 Illustrate 最大拆分份数
1 A 单字符无法拆分 1
2 AB A、B 各出现 1 次,无法拆分为多份 1
3 ABA A 出现 2 次、B 出现 1 次,无法拆分 1
4 ABAB A 出现 2 次、B 出现 2 次,可拆分为 2 份(”AB”+”AB”) 2

Function requirements

完成对应函数,输入为字符串 packages,返回一个长度为 n 的数组,其中第 i 个元素代表前缀长度为 i+1 时的最大拆分份数。

Ideas

Enumerate possible segment lengths (which must be factors of the total length), check if the character frequency is the same for each segment, and maintain a maximum segment count at each position. Output the list afterward.

Suggestions for the Amazon OA and HackerRank Sprint Phase

Once you have thoroughly mastered the high-frequency questions for Amazon SDE1, SDE2, or Intern 2026 OA preparation, your pass rate will significantly increase. April's questions have a clear overall approach but require strong temporary analytical capabilities.

Need detailed approaches and complete Python/Java code for these questions, as well as more variations or other latest OA problems from big companies (Meta, Google, ByteDance, Microsoft, etc.). Alternatively, you can consult Programhelp for such inquiries. OA Support Services Feel free to leave a message or send me a private message. I will provide targeted advice based on your specific situation.

Wish everyone a successful passage through Amazon OA in April and subsequently, and hope you are able to secure the desired Amazon offer as soon as possible. Keep pushing forward!

author avatar
Jory Wang Senior Software Engineer at Amazon
Senior Amazon Engineer with rich practical experience in the development of core systems for infrastructure, specializing in system scalability, reliability, and cost optimization. Currently focused on mentoring FAANG SDE interviews, helping over 30 candidates secure L5/L6 offers within a year.
END
 0