Complete Matrix / 2D Array Problem Sheet (2024–2025)

🔥 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

#ProblemLeetCode Link
1Set Matrix ZeroesLC 73
2Rotate Image (90° Clockwise)LC 48
3Spiral MatrixLC 54
4Spiral Matrix II (Generate Matrix)LC 59
5Spiral Matrix IIILC 885
6Transpose MatrixLC 867
7Flipping an ImageLC 832

🔹 Matrix Searching

#ProblemLeetCode Link
8Search a 2D MatrixLC 74
9Search a 2D Matrix IILC 240

🔹 Prefix Sum / Counting on Matrix

#ProblemLeetCode Link
10Range Sum Query 2D – ImmutableLC 304
11Matrix Block SumLC 1314

🔹 Grid State / Simulation (Pure Matrix, NOT Graph)

#ProblemLeetCode Link
12Game of LifeLC 289
13Island PerimeterLC 463

🔹 Row / Column / Diagonal Logic

#ProblemLeetCode Link
14Toeplitz MatrixLC 766
15Lucky Numbers in a MatrixLC 1380
16Diagonal TraverseLC 498
17Sort the Matrix DiagonallyLC 1329
18K Weakest Rows in a MatrixLC 1337

🔹 Coordinate / Ordering Logic

#ProblemLeetCode Link
19Matrix Cells in Distance OrderLC 1030

🔹 Utility / Basic Matrix Operations

#ProblemLeetCode Link
20Reshape the MatrixLC 566
21Matrix Diagonal SumLC 1572

📊 Summary

CategoryCount
Traversal / Rotation7
Search2
Prefix / Sum2
Simulation2
Row / Column / Diagonal5
Utility / Ordering3
TOTAL21

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


Comments (1)