🔥 Amazon SDE-1 | Complete Matrix / 2D Array Problem Sheet (2024–2025)
This is a fully merged matrix problem list for Amazon SDE-1 preparation, combining:
- Striver SDE Sheet matrix problems
- Amazon SDE-1 interview-extracted matrix problems
- Optional but useful matrix variants for Amazon interviews
✅ 21 Problems
❌ No graphs, no DP, no strings
💯 Focused purely on matrix / 2D array manipulation
🔹 Core Matrix Traversal / In-Place Manipulation
| # | Problem | LeetCode Link |
|---|
| 1 | Set Matrix Zeroes | LC 73 |
| 2 | Rotate Image (90° Clockwise) | LC 48 |
| 3 | Spiral Matrix | LC 54 |
| 4 | Spiral Matrix II (Generate Matrix) | LC 59 |
| 5 | Spiral Matrix III | LC 885 |
| 6 | Transpose Matrix | LC 867 |
| 7 | Flipping an Image | LC 832 |
🔹 Matrix Searching
| # | Problem | LeetCode Link |
|---|
| 8 | Search a 2D Matrix | LC 74 |
| 9 | Search a 2D Matrix II | LC 240 |
🔹 Prefix Sum / Counting on Matrix
| # | Problem | LeetCode Link |
|---|
| 10 | Range Sum Query 2D – Immutable | LC 304 |
| 11 | Matrix Block Sum | LC 1314 |
🔹 Grid State / Simulation (Pure Matrix, NOT Graph)
| # | Problem | LeetCode Link |
|---|
| 12 | Game of Life | LC 289 |
| 13 | Island Perimeter | LC 463 |
🔹 Row / Column / Diagonal Logic
| # | Problem | LeetCode Link |
|---|
| 14 | Toeplitz Matrix | LC 766 |
| 15 | Lucky Numbers in a Matrix | LC 1380 |
| 16 | Diagonal Traverse | LC 498 |
| 17 | Sort the Matrix Diagonally | LC 1329 |
| 18 | K Weakest Rows in a Matrix | LC 1337 |
🔹 Coordinate / Ordering Logic
| # | Problem | LeetCode Link |
|---|
| 19 | Matrix Cells in Distance Order | LC 1030 |
🔹 Utility / Basic Matrix Operations
| # | Problem | LeetCode Link |
|---|
| 20 | Reshape the Matrix | LC 566 |
| 21 | Matrix Diagonal Sum | LC 1572 |
📊 Summary
| Category | Count |
|---|
| Traversal / Rotation | 7 |
| Search | 2 |
| Prefix / Sum | 2 |
| Simulation | 2 |
| Row / Column / Diagonal | 5 |
| Utility / Ordering | 3 |
| TOTAL | 21 |
🎯 Amazon SDE-1 Matrix Focus
- In-place updates (Rotate, Set Zeroes, Flipping)
- Row/column dependencies (Toeplitz, Lucky Numbers)
- Index discipline (Diagonal Traverse, Spiral variants)
- Space-time tradeoffs awareness
- Core patterns interviewers test: traversal, search, counting, simulation
✅ Tip: Focus first on must-do traversal/search/simulation problems (LC 73, 48, 54, 289, 240) — these appear most often.