DSA

Top 50 DSA Questions for Amazon Interviews

High-frequency patterns from Amazon OA and onsite loops — arrays, trees, graphs, and greedy.

Kavya ReddyKavya Reddy
4 min read3 Jun 2026
Top 50 DSA Questions for Amazon Interviews
DSA

Share

Amazon DSA patterns at a glance

Amazon's coding rounds favor practical medium problems over obscure hard puzzles. The Online Assessment typically has 2 medium problems; onsite rounds add follow-up optimizations. These 50 questions cover the highest-frequency patterns from Amazon-tagged problems.

Arrays and strings (10)

  • Two Sum / Three Sum variants.
  • Maximum subarray (Kadane's algorithm).
  • Merge intervals.
  • Product of array except self.
  • Container with most water.
  • Longest substring without repeating characters.
  • Group anagrams.
  • Rotate array / find minimum in rotated sorted array.
  • Top K frequent elements.
  • Trapping rain water.

Trees and graphs (10)

  • Level order traversal (BFS).
  • Validate binary search tree.
  • Lowest common ancestor.
  • Number of islands (grid DFS/BFS).
  • Course schedule (topological sort).
  • Clone graph.
  • Word ladder (BFS shortest path).
  • Diameter of binary tree.
  • Serialize and deserialize binary tree.
  • Kth smallest element in BST.

Sliding window and two pointers (8)

  • Minimum window substring.
  • Longest repeating character replacement.
  • Fruit into baskets.
  • Subarray sum equals K.
  • Find all anagrams in a string.
  • Max consecutive ones III.
  • 3Sum closest.
  • Sort colors (Dutch national flag).

Heaps and binary search (7)

  • Kth largest element in an array.
  • Merge K sorted lists.
  • Find median from data stream.
  • Search in rotated sorted array.
  • Koko eating bananas (binary search on answer).
  • Meeting rooms II.
  • Reorganize string.

Dynamic programming and greedy (8)

  • Coin change.
  • Longest increasing subsequence.
  • House robber I and II.
  • Unique paths.
  • Task scheduler (greedy + heap).
  • Partition labels.
  • Jump game I and II.
  • Decode ways.

Amazon OA tips

Practice on a plain editor without autocomplete. Aim to finish both problems with working code. Run Amazon-style mocks on InterviewVeda before your OA date.

  • Read all test cases before coding.
  • Handle edge cases: empty input, single element, duplicates.
  • State complexity before optimizing.
  • Do not spend more than 5 minutes stuck — write brute force first.

7-day Amazon cram plan

If your OA is next week: Day 1–2 arrays/strings, Day 3 trees, Day 4 graphs/BFS, Day 5 heaps, Day 6 DP/greedy, Day 7 timed mock OAs.

#Amazon#DSA#Coding

Related articles

Top 50 SQL Interview Questions
DSA
7 min read·28 Jun 2026

Top 50 SQL Interview Questions

Joins, window functions, indexing, and query optimization — the SQL topics that appear in almost every data and backend interview.

Kavya Reddy

Kavya Reddy

Senior SDE Mentor

Continue

Practice what you learned with AI mock interviews and resume tools.

Get started free