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

amazon logo
amazon
September 4, 202516 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.

Full Experience

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.

Interview Questions (49)

Q1
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.

Q2
Lowest Common Ancestor of N-ary Tree
Data Structures & Algorithms

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

Q3
String Compression
Data Structures & Algorithms

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

Q4
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.

Q5
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.

Q6
Longest Palindromic Substring
Data Structures & Algorithms

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

Q7
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.

Q8
Integer to Roman
Data Structures & Algorithms

Convert an integer to its Roman numeral representation.

Q9
Roman to Integer
Data Structures & Algorithms

Convert a Roman numeral string to its integer representation.

Q10
Valid Parentheses
Data Structures & Algorithms

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

Q11
Merge K Sorted Lists
Data Structures & Algorithms

Merge k sorted linked lists into one sorted linked list.

Q12
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).

Q13
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.

Q14
Permutations
Data Structures & Algorithms

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

Q15
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.

Q16
Rotate List
Data Structures & Algorithms

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

Q17
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.

Q18
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).

Q19
Validate Binary Search Tree
Data Structures & Algorithms

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

Q20
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.

Q21
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).

Q22
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).

Q23
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.

Q24
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.

Q25
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.

Q26
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.

Q27
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.

Q28
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.

Q29
Min Stack Design
Data Structures & Algorithms

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

Q30
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.

Q31
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.

Q32
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.

Q33
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.

Q34
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.

Q35
Integer to English Words
Data Structures & Algorithms

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

Q36
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.

Q37
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.

Q38
Longest Increasing Subsequence
Data Structures & Algorithms

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

Q39
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.

Q40
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.

Q41
Minesweeper
Data Structures & Algorithms

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

Q42
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.

Q43
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.

Q44
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.

Q45
Sort Characters by Frequency
Data Structures & Algorithms

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

Q46
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.

Q47
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.

Q48
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.

Q49
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.

Preparation Tips

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.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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