Amazon SDE-1/2 interview questions 2025
Anonymous User
3680
TopicQuestions
Arrays- Find the missing number from a continuous vector of numbers.
- Two Missing Numbers.
- Find the only non-repeating element where every other element repeats twice.
- Modified Two Sum problem.
- Next Greater element in a circular array.
- Reverse Pairs.
- Two pointers question to find (i,j) pairs for a given condition.
- Return index where left ≤ element and right ≥ element (prefix/suffix arrays).
- Determine minimum daily capacity (X) to complete tasks in Y days (Binary Search).
- Find element in a matrix with sorted rows (Binary Search).
- Split Array Largest Sum (Binary Search).
- Remove K Digits (Greedy).
- Maximum Points from Cards (Sliding Window/Prefix Sum).
Strings- Replace consecutive characters with character and count (e.g., "aaabbb" → "a3b3").
- Longest Substring with All Distinct Characters (Sliding Window).
- Longest Palindromic Substring.
- Reorganize String (Heap/Greedy).
- Valid Parentheses (Stack).
- Construct a new string with no adjacent duplicates (Greedy/Heap).
- Longest Self-Contained Substring.
- Count Binary Substrings.
- Group Anagrams (Hashing).
- Word Break (DP).
Linked Lists- Remove consecutive nodes from a linked list with sum zero.
- Intersection of Two Linked Lists.
Trees- Zigzag Level Order Traversal of Binary Tree.
- Find Max Path Sum in Binary Tree (follow-up: print path).
- Count Nodes with Two Children (recursive & iterative).
- Validate Sum Tree.
- Distance between two nodes (parent pointers).
- Largest BST in a Binary Tree.
- Max Sum Level in Binary Tree.
- Path Sum I & II.
- Print All Possible Arrays that could create a given BST.
- House Robber (DP on trees).
Graphs- Number of Islands (DFS/BFS).
- Rotting Oranges (BFS).
- Minimum Steps to Reach Cell 9 in Grid (BFS).
- Keys and Rooms (DFS/BFS).
- Course Schedule II (Topological Sort).
- Minimum Knight Moves (BFS).
Dynamic Programming- Longest Common Subsequence.
- House Robber.
- Word Break.
- Max Path Sum in Binary Tree.
- Minimum Steps to Reach Last Index (Jump Game II).
- Minimum Time to Finish All Jobs (Binary Search + Greedy/DP).
Hashing- Three-Page Sequence with Max Count (HashMap).
- Group Anagrams (HashMap with sorted keys).
- Longest Consecutive Sequence (HashSet).
- Insert, Delete, GetRandom O(1) (HashMap + List).
- Count Good Review Words (HashMap).
Heaps/Priority Queues- Top K Frequent Words.
- Merge K Sorted Lists (implied in external sorting).
- Median from Data Stream (Two Heaps).
- Reorganize String (Heap).
- K Closest Warehouses (Heap).
Stacks/Queues- Valid Parentheses.
- Next Greater Element in Circular Array.
- Design Stack with push, pop, min in O(1) (Auxiliary Stack).
Binary Search- Square Root of a Number (with precision).
- Koko Eating Bananas.
- Allocate Minimum Pages.
- Split Array Largest Sum.
- Search in a Sorted Matrix.
Greedy Algorithms- Remove K Digits.
- Jump Game II.
- Minimum Platforms/GPUs Scheduling (Line Sweep/Two Pointers).
Backtracking- K-th Lexicographical Happy String.
- All Possible Arrays for BST (Combinatorics).
Bit Manipulation- Find Single Element in Sorted Array (XOR or Binary Search).
External Sorting- Sort a 500MB File with 2MB Heap (External Merge Sort).
System Design/OOP- Design Stack with min operation.
- LRU-like Cache (HashMap + Linked List).
- Add & Remove Methods with optimizations (Hash + List).
Comments (3)