Amazon SDE intern OA experience
871
Mar 21, 2026
May 29, 2026

So i had attended Amazon SDE intern OA on 17/03/2026 (on campus) and these were the 2 questions i got


Question 1: Warehouse Robots with Threshold

Problem Description
At an Amazon warehouse, there are n robots used for handling inventory and package movement. Each robot has a threshold value stored in an array arr, where arr[i] represents the minimum condition required for the i-th robot to function.

Every robot can be assigned one of two states:

  • Active — currently operating in the warehouse
  • Idle — waiting for tasks

A configuration is considered valid if all robots satisfy the following conditions:

  • If a robot is Active, then the total number of active robots in the warehouse must be greater than or equal to arr[i].
  • If a robot is Idle, then the total number of idle robots in the warehouse must be strictly less than arr[i].

Given the array arr, determine the number of valid robot configurations possible.

Task
Return the total number of valid configurations.

Constraints
Each robot must be assigned exactly one state.
A configuration is valid only if no robot violates its condition.


Question 2: Most Common Product Pair

Problem Description
On Amazon e-commerce platform, customer purchase activity is recorded as transaction history. Each customer has a history of items they bought together across multiple orders. You are given a list of customers, where each customer's record contains a list of products bought together. Each trasaction represents products that were purchased together in a single order.

Example:

[('A', 'B', 'E'), ('C', 'D')]
[('A', 'E')]
[('C', 'B'), ('D', 'C')]
[('A', 'B')]
[('A', 'C')]

Task
Return the pair of products that appears together most frequently across all transactions.

Rules
A pair consists of distinct products.
(A, B) and (B, A) are considered the same pair.
If multiple pairs have the same highest frequency, return the lexicographically smallest pair.

Notes
Duplicate items within a transaction should be counted only once.
Each transaction can contribute multiple pairs.

Comments (1)