Matrix DSA Problems

246 matrix problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 246: 35 easy, 1 medium and 64 hard. Practise them free on InternHack and track what you have solved.

Matrix problems, easiest first

  1. Available Captures for Rook (Easy)
  2. Check if Every Row and Column Contains All Numbers (Easy)
  3. Check if Matrix Is X-Matrix (Easy)
  4. Convert 1D Array Into 2D Array (Easy)
  5. Count Negative Numbers in a Sorted Matrix (Easy)
  6. Delete Greatest Value in Each Row (Easy)
  7. Determine Whether Matrix Can Be Obtained By Rotation (Easy)
  8. Find Champion I (Easy)
  9. Find Missing and Repeated Values (Easy)
  10. Find the Width of Columns of a Grid (Easy)
  11. Find Winner on a Tic Tac Toe Game (Easy)
  12. Flipping an Image (Easy)
  13. Flood Fill (Easy)
  14. Image Smoother (Easy)
  15. Island Perimeter (Easy)
  16. Largest Local Values in a Matrix (Easy)
  17. Lucky Numbers in a Matrix (Easy)
  18. Matrix Cells in Distance Order (Easy)
  19. Matrix Diagonal Sum (Easy)
  20. Matrix Similarity After Cyclic Shifts (Easy)
  21. Minimum Operations to Make Columns Strictly Increasing (Easy)
  22. Modify the Matrix (Easy)
  23. Prime In Diagonal (Easy)
  24. Projection Area of 3D Shapes (Easy)
  25. Reshape the Matrix (Easy)
  26. Richest Customer Wealth (Easy)
  27. Row With Maximum Ones (Easy)
  28. Shift 2D Grid (Easy)
  29. Special Positions in a Binary Matrix (Easy)
  30. Surface Area of 3D Shapes (Easy)
  31. The K Weakest Rows in a Matrix (Easy)
  32. Toeplitz Matrix (Easy)
  33. Transpose Matrix (Easy)
  34. Valid Word Square (Easy)
  35. Zigzag Grid Traversal With Skip (Easy)
  36. 01 Matrix (Medium)
  37. Check if There Is a Valid Parentheses String Path (Hard)
  38. Best Meeting Point (Hard)
  39. Bricks Falling When Hit (Hard)
  40. Build a Matrix With Conditions (Hard)
  41. Cat and Mouse II (Hard)
  42. Cherry Pickup (Hard)
  43. Cherry Pickup II (Hard)
  44. Contain Virus (Hard)
  45. Count Fertile Pyramids in a Land (Hard)
  46. Count Routes to Climb a Rectangular Grid (Hard)
  47. Cut Off Trees for Golf Event (Hard)
  48. Design Excel Sum Formula (Hard)
  49. Dungeon Game (Hard)
  50. Escape the Spreading Fire (Hard)
  51. Find the Kth Smallest Sum of a Matrix With Sorted Rows (Hard)
  52. Find the Maximum Number of Fruits Collected (Hard)
  53. Find the Minimum Area to Cover All Ones II (Hard)
  54. Find the String with LCP (Hard)
  55. Last Day Where You Can Still Cross (Hard)
  56. Length of Longest V-Shaped Diagonal Segment (Hard)
  57. Longest Increasing Path in a Matrix (Hard)
  58. Making A Large Island (Hard)
  59. Max Sum of Rectangle No Larger Than K (Hard)
  60. Maximal Rectangle (Hard)
  61. Maximum Number of Points From Grid Queries (Hard)
  62. Maximum Score From Grid Operations (Hard)
  63. Maximum Spending After Buying Items (Hard)
  64. Maximum Students Taking Exam (Hard)
  65. Maximum Vacation Days (Hard)
  66. Minimize Maximum Value in a Grid (Hard)
  67. Minimum Cost Path with Teleportations (Hard)
  68. Minimum Cost to Connect Two Groups of Points (Hard)
  69. Minimum Cost to Make at Least One Valid Path in a Grid (Hard)
  70. Minimum Falling Path Sum II (Hard)
  71. Minimum Moves to Move a Box to Their Target Location (Hard)
  72. Minimum Moves to Reach Target with Rotations (Hard)
  73. Minimum Number of Days to Disconnect Island (Hard)
  74. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix (Hard)
  75. Minimum Number of Visited Cells in a Grid (Hard)
  76. Minimum Obstacle Removal to Reach Corner (Hard)
  77. Minimum Operations to Remove Adjacent Ones in Matrix (Hard)
  78. Minimum Time Takes to Reach Destination Without Drowning (Hard)
  79. Minimum Time to Visit a Cell In a Grid (Hard)
  80. Number of Distinct Islands II (Hard)
  81. Number of Increasing Paths in a Grid (Hard)
  82. Number of Paths with Max Score (Hard)
  83. Number of Submatrices That Sum to Target (Hard)
  84. Number of Ways of Cutting a Pizza (Hard)
  85. Paths in Matrix Whose Sum Is Divisible by K (Hard)
  86. Rank Transform of a Matrix (Hard)
  87. Shortest Distance from All Buildings (Hard)
  88. Shortest Path in a Grid with Obstacles Elimination (Hard)
  89. Shortest Path to Get All Keys (Hard)
  90. Sliding Puzzle (Hard)
  91. Smallest Rectangle Enclosing Black Pixels (Hard)
  92. Stamping the Grid (Hard)
  93. Strange Printer II (Hard)
  94. Sudoku Solver (Hard)
  95. Swim in Rising Water (Hard)
  96. The Maze III (Hard)
  97. Transform to Chessboard (Hard)
  98. Trapping Rain Water II (Hard)
  99. Unique Paths III (Hard)
  100. Word Search II (Hard)

Companies that ask matrix problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics