Amazon SDE Intern OA Questions 2026 Review|Two questions in 70 minutes Medium-Hard

30 Views
No Comment

Amazon 26 Intern's OA has begun to be issued on a large scale again. This round is still the familiar HackerRank platform. Two questions last 70 minutes. The overall experience is one sentence: tight time + poor questions + easy to get stuck in details. This article will restore the latest batch of amazon sde intern oa questions to you, the real experience of doing questions + a summary of high-frequency question types, and talk about how to prepare.

Amazon SDE Intern OA Questions 2026 Review|Two questions in 70 minutes Medium-Hard

Amazon 2026 Intern OA Basic Information

This round of OA configuration is relatively stable:

  • Platform: HackerRank
  • Number of questions: 2 coding
  • Duration: 70 minutes
  • Difficulty: Medium – Hard
  • Pace: An average question lasts 30-35 minutes (but in fact many people get stuck on the first question)

Amazon SDE Intern OA Questions Share

Code Question 1

一家金融服务公司请求在 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]
  • 分组方式:
    • 安全等级 2:2 台 → 1 组
    • 安全等级 3:3 台 → 1 组
    • 安全等级 1:1 台 → 1 组
  • 最终最少安全组数量为 3.

Problem-solving ideas

First, frequency statistics are performed on the security level array to obtain the number of servers corresponding to each security level, and the original problem is transformed into a group planning problem for these frequency values. The core constraints are: servers of the same security level must be divided into the same type of grouping, and the capacities of all groups can only be equal or the difference does not exceed 1; the goal is to minimize the total number of final security groups. Based on the greedy strategy to achieve the optimal solution, try starting from the maximum feasible grouping capacity and verify one by one whether all frequency values ​​can be split into groups that meet the capacity constraints and meet the division requirements of all security levels. The total number of groups corresponding to the first grouping scheme that meets the conditions is the minimum number of security groups required.

Code Question 2

亚马逊的一个团队正在确保所有包裹都能正确分拣以便配送。每个包裹都有一个由大写英文字母表示的标签,完整的标签列表以字符串 packages 形式给出,其中第 I 个字符代表第 I 个包裹的标签。

为优化分拣流程,团队希望分析字符串 packages 的每个前缀(长度从 1 到 n),并确定它最多可以被划分为多少个等长部分。划分时必须满足以下条件:

  • 在该划分方式下,每个部分中每种字符的出现频率都完全相同。

given string packages,请针对每个前缀 T(长度从 1 到 n),计算出该前缀最多可被划分为多少个等长部分,使得每个部分中每种字符的出现次数都一致。

Example:

  • Enter:packages = "ABAB"
  • 各前缀结果:表格前缀长度前缀字符串解释最大等分段数1″A”单个字符无法划分12″AB”无法满足各段字符频率相同13″ABA”无法满足各段字符频率相同14″ABAB”可划分为 “AB” 和 “AB”,两段字符频率均为 A:1, B:12

Problem-solving ideas

Relying on prefix and array preprocessing character frequency distribution, O (1) fast query of any substring character frequency can be realized, greatly improving efficiency. Traverse all prefixes of the string (length from 1 to n), and for each prefix of length i, enumerate the number of equal-length segments k that it can be divided into: this division method is valid only when i can be evenly divided by k. In this case, the prefix is ​​divided into k consecutive sub-blocks of length i/k. Taking the first sub-block as the benchmark, check whether the character frequencies of all subsequent sub-blocks are completely consistent with the benchmark. If they all match, k is the maximum feasible number of divisions of the current prefix. At the same time, pruning optimization is added. If any sub-block does not match during the verification process, the current partition verification will be directly terminated to avoid invalid calculations and ensure the efficient operation of the overall algorithm.

Amazon OA is tight on time and has many details

Feedback from many students: Although the two Medium-Hard questions on Amazon SDE Intern OA look familiar, it is really stressful to quickly clarify your ideas and write cleanly to pass all test cases within 70 minutes. Programhelp team focuses on large manufacturers OA/VO actual assists , helping hundreds of students efficiently pass OA such as Amazon, Meta, Roblox, etc., with a nearly 100% passing rate. Whether it is your first time to purchase Amazon 26 Intern or you have been stuck once, you can contact us to learn about the plan.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0