HackTheRounds Interview Experiences
Amazon OA HackerRank Questions 2026: Latest Coding Problems, Solutions & Prep Guide
Breakdown of the latest Amazon Online Assessment HackerRank questions for 2026 SDE roles, with problem descriptions, approaches, and preparation strategies.
By HackTheRounds Team · 2026-04-03
Overview
Amazon's 2026 Online Assessment (OA) for SDE roles continues to use HackerRank as their platform. The assessment typically consists of 2-3 coding problems to be completed in 70-90 minutes , followed by a work simulation and work style survey.
Here's a breakdown of the latest question patterns we've seen reported in April 2026.
---
Question 1: Minimum Number of Security Groups
Difficulty: Medium
You're given an array of security levels for servers. Servers with identical security levels must be grouped together, and any two groups' sizes can differ by at most 1. Return the minimum number of security groups needed.
Approach: This is a counting + math problem. Count the frequency of each distinct security level, then for each group, determine how to split servers into groups of size floor(n/k) and ceil(n/k) where k is the number of groups.
Key Insight: Think about the constraints — when groups must have sizes differing by at most 1, you're essentially distributing items as evenly as possible. This is a classic "minimum partitions" pattern.
---
Question 2: Maximum Secure Inventory Total
Difficulty: Medium-Hard
You manage k warehouses receiving delivery batches. After all deliveries, the warehouses storing the most inventory get breached. Only the remaining secure warehouses count toward your total inventory. Maximize the total secure inventory.
Approach: Greedy + sorting. After simulating deliveries, sort warehouse totals. The key decision is which warehouses to "sacrifice" (let get breached) to maximize the sum of the remaining ones.
Key Insight: This reduces to: after computing all warehouse totals, remove the top m warehouses and return the sum of the rest. The challenge is figuring out the optimal assignment of deliveries to warehouses.
---
Question 3: Virtual Machine Rental Revenue
Difficulty: Hard
You manage VM rental operations. Each rental request costs: min(non-zero availability across VM types) + max(availability across VM types) . Process m sequential rental requests and calculate cumulative revenue.
Approach: Simulation with efficient data structure maintenance. Use a sorted structure or heap to track availability across VM types, updating after each rental.
Key Insight: The tricky part is efficiently computing "minimum non-zero availability" as VMs get rented out and some types hit zero.
---
Question 4: Package Label Maximum Split Portions
Difficulty: Hard
Given a string, for each prefix position, return the maximum number of equal-length parts the prefix can be split into such that all parts have identical character frequencies.
Approach: For each prefix length L , check all divisors k of L . For each divisor, verify if splitting into k parts of length L/k results in identical character frequency distributions. Track frequencies with arrays.
Key Insight: Precompute prefix frequency counts. For a given split, you only need to check that freq[i len/k] - freq[(i-1) len/k] is identical for all parts i .
---
Amazon OA Preparation Tips
- Time management is critical — you get 70-90 minutes for 2-3 problems. Don't spend more than 30 min on any single problem.
- Amazon loves greedy + sorting — many problems reduce to sorting then making optimal choices.
- Edge cases matter — empty arrays, single elements, all-same values. Amazon's test cases are thorough.
- The work simulation section counts — don't rush through it. It evaluates your decision-making aligned with Amazon's Leadership Principles.
- Practice on HackerRank specifically — the IDE is different from LeetCode. Get comfortable with their I/O format.
[[problem/872?company=3|Prime Jumps]] and [[problem/873?company=3|Minimum Edge Reversals]] are examples of the difficulty level Amazon targets in their harder OA problems.
---
Have you recently taken an Amazon OA? Submit your interview experience to help others prepare and earn free premium access.