Amazon Interview Drilldown: Reddit Questions
Based on real posts from Reddit users who underwent Amazon interviews and common problem lists on there, this guide presents authentic problems, structured explanations and sample walkthroughs to help you connect the dots for preparation.
1. Online Assessment: Attractive Number (Reddit OA Report)
Problem:
Given a number num as a string and integer k, define num as attractive if every digit is equal to the digit k positions ahead (num[i] == num[i+k]). Return the smallest attractive number ≥ num.
Topic Hint:
Constructive string manipulation + iteration.
Explanation:
Build a candidate by repeating the first k digits:
e.g., num = "25352", k = 2 → candidate "25252".
If it’s less than num, increment the first k-digit chunk and repeat (→ "26262").
Example:
Input: num = "25352", k = 2
Base chunk: "25" → candidate = "25252" (less than num)
Increment chunk: "26" → "26262" (≥ num)
Output: "26262"
Source: Reddit
2. Range-Minimax Expense Partition (Reddit)
Problem:
Given an array expense[] and integer p, partition the array into p contiguous segments. The cost of each segment is the sum of its endpoints. Compute the minimum and maximum total segment cost.
Topic Hint:
Prefix sums + sorting.
Explanation:
Compute base cost: expense[0] + expense[n-1].
Build all possible “cut costs” by summing adjacent pairs.
Sort cut-cost candidates.
- Minimum total = base + sum of smallest (p−1).
- Maximum total = base + sum of largest (p−1).
Example:
Input: expense = [1,2,3,4], p = 2
Base = 1 + 4 = 5
Cut costs = [3,5,7]
Minimum = 5 + 3 = 8,
Maximum = 5 + 7 = 12
Output: [8,12]
Source: Reddit
3. Topic Patterns from Reddit Whisper
Reported Themes:
Arrays, BFS, Topological Sorting, Union-Find, Trees appear frequently in Amazon interviews.
I recently interviewed with Amazon and the questions covered topics like Arrays,
BFS, Topological Sorting, Union Find and Trees.
Actionable Patterns:
- Arrays: Sliding window, two pointers.
- Graphs / Trees: BFS/DFS, LCA, connectivity, topological order.
- Union-Find: Cycle detection, grouping.
Example Amazon-Style Problem:
Course Schedule (Topological Sort):
Given courses and dependencies, decide if you can complete all.
→ Build graph → in-degree → Kahn’s algorithm → check for cycle.
4. Top Amazon Coding Problems (Reddit Analysis)
A data-backed Reddit post analyzed ~300+ Amazon interviews and ranked the most frequently asked DSA problems.
Key Tier 1 OA Problems (40%+ frequency):
- Number of Islands (43%)
- LRU Cache (41%)
- Merge Two Sorted Lists (39%)
- Maximum Subarray (38%)
- Best Time to Buy and Sell Stock (37%)
- Product of Array Except Self (35%)
- Reverse Linked List (34%)
- Two Sum (33%)
- Longest Palindrome (32%)
- Linked List Cycle (31%)
- Palindrome Linked List (30%)
- Intersection of Two Linked Lists (29%)
- Invert Binary Tree (28%)
- Binary Tree Inorder Traversal (27%)
- Set Matrix Zeroes (26%)
Phone Screen Favorites:
Longest Substring Without Repeating Characters, Longest Palindromic Substring, 3Sum, Group Anagrams, Merge Intervals, Valid Parentheses,
Valid Anagram, Word Search, Top K Frequent Elements, etc.
Onsite Differentiators:
Merge K Sorted Lists, Trapping Rain Water, Sliding Window Maximum, Serialize/Deserialize Tree, Course Schedule, Trie, Kth Largest Element,
Longest Increasing Subsequence, etc.
