🔥 Amazon SDE Interview Questions (Real Experiences + LeetCode Links)

Posted
4 Sept 2025
590 reads

Summary

I've compiled a comprehensive list of Amazon SDE interview questions gathered from various real candidate experiences on platforms like Reddit and LeetCode Discuss. This provides a clear overview of the types of coding, design, and behavioral problems typically encountered.

How it went

After meticulously reviewing numerous Amazon Software Development Engineer interview experiences, I've identified recurring patterns and specific problems that candidates face. These insights span from new-grad loops to SDE1 roles across different global locations like the US and India. The coding rounds consistently feature problems similar to those found on LeetCode, covering various data structures and algorithms.

I've noted instances of problems requiring dynamic programming with bitmasking, graph traversal, tree manipulations, and string processing. Behavioral questions, often framed around Amazon's Leadership Principles, are also a standard part of the process, sometimes integrated with technical discussions. Some rounds specifically test system design and low-level design capabilities. Overall, the process appears to be rigorous, demanding a solid foundation in core computer science concepts and problem-solving.

Questions asked (49)

  1. 01

    Majority Element

    Data Structures & Algorithms

    Find the majority element in an array. The majority element is the element that appears more than ⌊n / 2⌋ times.

  2. 02

    Lowest Common Ancestor of N-ary Tree

    Data Structures & Algorithms

    Find the lowest common ancestor of two nodes in an N-ary tree.

  3. 03

    String Compression

    Data Structures & Algorithms

    Compress a string such that consecutive repeating characters are replaced with the character and count, e.g., 'aaabbbccc' -> 'a3b3c3'.

  4. 04

    Two Sum

    Data Structures & Algorithms

    Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

  5. 05

    Median of Two Sorted Arrays

    Data Structures & Algorithms

    Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

  6. 06

    Longest Palindromic Substring

    Data Structures & Algorithms

    Given a string s, return the longest palindromic substring in s.

  7. 07

    String to Integer (atoi)

    Data Structures & Algorithms

    Implement the atoi function, which converts a string to an integer, handling various edge cases like whitespace, sign, and overflow.

  8. 08

    Integer to Roman

    Data Structures & Algorithms

    Convert an integer to its Roman numeral representation.

  9. 09

    Roman to Integer

    Data Structures & Algorithms

    Convert a Roman numeral string to its integer representation.

  10. 10

    Valid Parentheses

    Data Structures & Algorithms

    Given a string s containing just the characters '(', ')', '{', '}', '[', ']', determine if the input string is valid.

  11. 11

    Merge K Sorted Lists

    Data Structures & Algorithms

    Merge k sorted linked lists into one sorted linked list.

  12. 12

    Valid Sudoku

    Data Structures & Algorithms

    Determine if a 9x9 Sudoku board is valid according to Sudoku rules (each row, column, and 3x3 sub-grid must contain digits 1-9 without repetition).

  13. 13

    Combination Sum

    Data Structures & Algorithms

    Given a set of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. The same repeated number may be chosen from candidates an unlimited number of times.

  14. 14

    Permutations

    Data Structures & Algorithms

    Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

  15. 15

    Merge Intervals

    Data Structures & Algorithms

    Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

  16. 16

    Rotate List

    Data Structures & Algorithms

    Given the head of a linked list, rotate the list to the right by k places.

  17. 17

    Minimum Path Sum

    Data Structures & Algorithms

    Given an m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

  18. 18

    Word Search

    Data Structures & Algorithms

    Given an m x n grid of characters and a string word, return true if word exists in the grid (formed by adjacent cells horizontally or vertically).

  19. 19

    Validate Binary Search Tree

    Data Structures & Algorithms

    Given the root of a binary tree, determine if it is a valid binary search tree (BST).

  20. 20

    Same Tree

    Data Structures & Algorithms

    Given the roots of two binary trees p and q, return true if they are the same tree, or false otherwise.

  21. 21

    Symmetric Tree

    Data Structures & Algorithms

    Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

  22. 22

    Binary Tree Level Order Traversal

    Data Structures & Algorithms

    Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

  23. 23

    Convert Sorted List to Binary Search Tree

    Data Structures & Algorithms

    Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.

  24. 24

    Populating Next Right Pointers in Each Node

    Data Structures & Algorithms

    Populate each next pointer to point to its next right node in a perfect binary tree. If there is no next right node, the next pointer should be set to NULL.

  25. 25

    Best Time to Buy and Sell Stock

    Data Structures & Algorithms

    You are given an array prices where prices[i] is the price of a given stock on the i-th day. Find the maximum profit you can achieve by buying on one day and selling on a different day.

  26. 26

    Word Ladder

    Data Structures & Algorithms

    Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord.

  27. 27

    Word Ladder II

    Data Structures & Algorithms

    Given two words, beginWord and endWord, and a dictionary wordList, return all shortest transformation sequences from beginWord to endWord.

  28. 28

    LRU Cache Design

    Data Structures & Algorithms

    Design and implement a Least Recently Used (LRU) cache with get and put operations, both running in O(1) average time complexity.

  29. 29

    Min Stack Design

    Data Structures & Algorithms

    Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

  30. 30

    Number of Islands

    Data Structures & Algorithms

    Given an m x n 2D binary grid which represents a map of '1's (land) and '0's (water), return the number of islands.

  31. 31

    Course Schedule

    Data Structures & Algorithms

    Given the total number of courses and a list of prerequisite pairs, return true if you can finish all courses.

  32. 32

    Course Schedule II

    Data Structures & Algorithms

    Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses.

  33. 33

    Design Add and Search Word Data Structure

    Data Structures & Algorithms

    Design a data structure that supports adding new words and finding if a string matches any previously added word. The search function can use '.' for any single character.

  34. 34

    Word Search II

    Data Structures & Algorithms

    Given an m x n board of characters and a list of strings words, return all words on the board that can be found by following sequences of letters.

  35. 35

    Integer to English Words

    Data Structures & Algorithms

    Convert a non-negative integer to its English words representation.

  36. 36

    Game of Life

    Data Structures & Algorithms

    Implement Conway's Game of Life. Given a 2D board representing the current state of a grid with cells that are either live (1) or dead (0), update the board to the next state.

  37. 37

    Find Median from Data Stream

    Data Structures & Algorithms

    The median is the middle value in an ordered integer list. Design a data structure that supports adding integers and finding the median of the current numbers.

  38. 38

    Longest Increasing Subsequence

    Data Structures & Algorithms

    Given an integer array nums, return the length of the longest strictly increasing subsequence.

  39. 39

    Design Tic-Tac-Toe

    Data Structures & Algorithms

    Design a Tic-Tac-Toe game that can be played on an n x n grid. Implement functions to make a move and check for a winner.

  40. 40

    Pacific Atlantic Water Flow

    Data Structures & Algorithms

    Given an m x n matrix of integers representing the height of each unit cell in a continent, find a list of grid coordinates where water can flow to both the Pacific and Atlantic oceans.

  41. 41

    Minesweeper

    Data Structures & Algorithms

    Given a 2D board representing a Minesweeper game, update it to its next state given the click coordinates.

  42. 42

    Diameter of Binary Tree

    Data Structures & Algorithms

    Given the root of a binary tree, return the length of the diameter of the tree. The diameter is the length of the longest path between any two nodes in a tree.

  43. 43

    Reorganize String

    Data Structures & Algorithms

    Given a string s, rearrange the characters of s such that any two adjacent characters are not the same. If it is not possible, return an empty string.

  44. 44

    Count Nodes in Complete Binary Tree

    Data Structures & Algorithms

    Given the root of a complete binary tree, return the number of nodes in the tree.

  45. 45

    Sort Characters by Frequency

    Data Structures & Algorithms

    Given a string s, sort it in decreasing order based on the frequency of the characters.

  46. 46

    Aggressive Cows

    Data Structures & Algorithms

    Given an array representing n stalls and k aggressive cows, assign k cows to k stalls such that the minimum distance between any two of them is maximized.

  47. 47

    Directed Graph Edge Score

    Data Structures & Algorithms

    Given a directed graph, find the node that has the highest edge score. The edge score of a node is the sum of the values of all nodes that point to it.

  48. 48

    Count Anagrammatic Substrings

    Data Structures & Algorithms

    Given two strings s1 and s2, count the total number of substrings in s2 that are anagrams of s1.

  49. 49

    Shortest Path Visiting All Nodes (LC 847)

    Data Structures & Algorithms

    You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge. Return the length of the shortest path that visits every node in the graph. You may start and stop at any node, and you may revisit nodes multiple times. The problem is a variant of TSP solvable with DP + bitmasking.

    Open the problem

How they prepared

Based on these collective experiences, my preparation would involve a strong focus on LeetCode problems, particularly those frequently reported by Amazon candidates. I would categorize and practice problems across common themes like arrays, strings, trees, graphs, dynamic programming, and data structure design. Additionally, I would dedicate time to understanding and articulating solutions to system design questions and meticulously prepare examples for behavioral questions aligned with Amazon's Leadership Principles. Reviewing specific LeetCode problem patterns, especially those involving optimized approaches like DP with bitmasking, would be crucial.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!