# Matrix DSA Problems

> 246 Matrix coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/matrix
Last updated: 2026-11-28

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](https://www.internhack.in/learn/dsa/problem/available-captures-for-rook) (Easy)
2. [Check if Every Row and Column Contains All Numbers](https://www.internhack.in/learn/dsa/problem/check-if-every-row-and-column-contains-all-numbers) (Easy)
3. [Check if Matrix Is X-Matrix](https://www.internhack.in/learn/dsa/problem/check-if-matrix-is-x-matrix) (Easy)
4. [Convert 1D Array Into 2D Array](https://www.internhack.in/learn/dsa/problem/convert-1d-array-into-2d-array) (Easy)
5. [Count Negative Numbers in a Sorted Matrix](https://www.internhack.in/learn/dsa/problem/count-negative-numbers-in-a-sorted-matrix) (Easy)
6. [Delete Greatest Value in Each Row](https://www.internhack.in/learn/dsa/problem/delete-greatest-value-in-each-row) (Easy)
7. [Determine Whether Matrix Can Be Obtained By Rotation](https://www.internhack.in/learn/dsa/problem/determine-whether-matrix-can-be-obtained-by-rotation) (Easy)
8. [Find Champion I](https://www.internhack.in/learn/dsa/problem/find-champion-i) (Easy)
9. [Find Missing and Repeated Values](https://www.internhack.in/learn/dsa/problem/find-missing-and-repeated-values) (Easy)
10. [Find the Width of Columns of a Grid](https://www.internhack.in/learn/dsa/problem/find-the-width-of-columns-of-a-grid) (Easy)
11. [Find Winner on a Tic Tac Toe Game](https://www.internhack.in/learn/dsa/problem/find-winner-on-a-tic-tac-toe-game) (Easy)
12. [Flipping an Image](https://www.internhack.in/learn/dsa/problem/flipping-an-image) (Easy)
13. [Flood Fill](https://www.internhack.in/learn/dsa/problem/flood-fill) (Easy)
14. [Image Smoother](https://www.internhack.in/learn/dsa/problem/image-smoother) (Easy)
15. [Island Perimeter](https://www.internhack.in/learn/dsa/problem/island-perimeter) (Easy)
16. [Largest Local Values in a Matrix](https://www.internhack.in/learn/dsa/problem/largest-local-values-in-a-matrix) (Easy)
17. [Lucky Numbers in a Matrix](https://www.internhack.in/learn/dsa/problem/lucky-numbers-in-a-matrix) (Easy)
18. [Matrix Cells in Distance Order](https://www.internhack.in/learn/dsa/problem/matrix-cells-in-distance-order) (Easy)
19. [Matrix Diagonal Sum](https://www.internhack.in/learn/dsa/problem/matrix-diagonal-sum) (Easy)
20. [Matrix Similarity After Cyclic Shifts](https://www.internhack.in/learn/dsa/problem/matrix-similarity-after-cyclic-shifts) (Easy)
21. [Minimum Operations to Make Columns Strictly Increasing](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-columns-strictly-increasing) (Easy)
22. [Modify the Matrix](https://www.internhack.in/learn/dsa/problem/modify-the-matrix) (Easy)
23. [Prime In Diagonal](https://www.internhack.in/learn/dsa/problem/prime-in-diagonal) (Easy)
24. [Projection Area of 3D Shapes](https://www.internhack.in/learn/dsa/problem/projection-area-of-3d-shapes) (Easy)
25. [Reshape the Matrix](https://www.internhack.in/learn/dsa/problem/reshape-the-matrix) (Easy)
26. [Richest Customer Wealth](https://www.internhack.in/learn/dsa/problem/richest-customer-wealth) (Easy)
27. [Row With Maximum Ones](https://www.internhack.in/learn/dsa/problem/row-with-maximum-ones) (Easy)
28. [Shift 2D Grid](https://www.internhack.in/learn/dsa/problem/shift-2d-grid) (Easy)
29. [Special Positions in a Binary Matrix](https://www.internhack.in/learn/dsa/problem/special-positions-in-a-binary-matrix) (Easy)
30. [Surface Area of 3D Shapes](https://www.internhack.in/learn/dsa/problem/surface-area-of-3d-shapes) (Easy)
31. [The K Weakest Rows in a Matrix](https://www.internhack.in/learn/dsa/problem/the-k-weakest-rows-in-a-matrix) (Easy)
32. [Toeplitz Matrix](https://www.internhack.in/learn/dsa/problem/toeplitz-matrix) (Easy)
33. [Transpose Matrix](https://www.internhack.in/learn/dsa/problem/transpose-matrix) (Easy)
34. [Valid Word Square](https://www.internhack.in/learn/dsa/problem/valid-word-square) (Easy)
35. [Zigzag Grid Traversal With Skip](https://www.internhack.in/learn/dsa/problem/zigzag-grid-traversal-with-skip) (Easy)
36. [01 Matrix](https://www.internhack.in/learn/dsa/problem/01-matrix) (Medium)
37. [Check if There Is a Valid Parentheses String Path](https://www.internhack.in/learn/dsa/problem/check-if-there-is-a-valid-parentheses-string-path) (Hard)
38. [Best Meeting Point](https://www.internhack.in/learn/dsa/problem/best-meeting-point) (Hard)
39. [Bricks Falling When Hit](https://www.internhack.in/learn/dsa/problem/bricks-falling-when-hit) (Hard)
40. [Build a Matrix With Conditions](https://www.internhack.in/learn/dsa/problem/build-a-matrix-with-conditions) (Hard)
41. [Cat and Mouse II](https://www.internhack.in/learn/dsa/problem/cat-and-mouse-ii) (Hard)
42. [Cherry Pickup](https://www.internhack.in/learn/dsa/problem/cherry-pickup) (Hard)
43. [Cherry Pickup II](https://www.internhack.in/learn/dsa/problem/cherry-pickup-ii) (Hard)
44. [Contain Virus](https://www.internhack.in/learn/dsa/problem/contain-virus) (Hard)
45. [Count Fertile Pyramids in a Land](https://www.internhack.in/learn/dsa/problem/count-fertile-pyramids-in-a-land) (Hard)
46. [Count Routes to Climb a Rectangular Grid](https://www.internhack.in/learn/dsa/problem/count-routes-to-climb-a-rectangular-grid) (Hard)
47. [Cut Off Trees for Golf Event](https://www.internhack.in/learn/dsa/problem/cut-off-trees-for-golf-event) (Hard)
48. [Design Excel Sum Formula](https://www.internhack.in/learn/dsa/problem/design-excel-sum-formula) (Hard)
49. [Dungeon Game](https://www.internhack.in/learn/dsa/problem/dungeon-game) (Hard)
50. [Escape the Spreading Fire](https://www.internhack.in/learn/dsa/problem/escape-the-spreading-fire) (Hard)
51. [Find the Kth Smallest Sum of a Matrix With Sorted Rows](https://www.internhack.in/learn/dsa/problem/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows) (Hard)
52. [Find the Maximum Number of Fruits Collected](https://www.internhack.in/learn/dsa/problem/find-the-maximum-number-of-fruits-collected) (Hard)
53. [Find the Minimum Area to Cover All Ones II](https://www.internhack.in/learn/dsa/problem/find-the-minimum-area-to-cover-all-ones-ii) (Hard)
54. [Find the String with LCP](https://www.internhack.in/learn/dsa/problem/find-the-string-with-lcp) (Hard)
55. [Last Day Where You Can Still Cross](https://www.internhack.in/learn/dsa/problem/last-day-where-you-can-still-cross) (Hard)
56. [Length of Longest V-Shaped Diagonal Segment](https://www.internhack.in/learn/dsa/problem/length-of-longest-v-shaped-diagonal-segment) (Hard)
57. [Longest Increasing Path in a Matrix](https://www.internhack.in/learn/dsa/problem/longest-increasing-path-in-a-matrix) (Hard)
58. [Making A Large Island](https://www.internhack.in/learn/dsa/problem/making-a-large-island) (Hard)
59. [Max Sum of Rectangle No Larger Than K](https://www.internhack.in/learn/dsa/problem/max-sum-of-rectangle-no-larger-than-k) (Hard)
60. [Maximal Rectangle](https://www.internhack.in/learn/dsa/problem/maximal-rectangle) (Hard)
61. [Maximum Number of Points From Grid Queries](https://www.internhack.in/learn/dsa/problem/maximum-number-of-points-from-grid-queries) (Hard)
62. [Maximum Score From Grid Operations](https://www.internhack.in/learn/dsa/problem/maximum-score-from-grid-operations) (Hard)
63. [Maximum Spending After Buying Items](https://www.internhack.in/learn/dsa/problem/maximum-spending-after-buying-items) (Hard)
64. [Maximum Students Taking Exam](https://www.internhack.in/learn/dsa/problem/maximum-students-taking-exam) (Hard)
65. [Maximum Vacation Days](https://www.internhack.in/learn/dsa/problem/maximum-vacation-days) (Hard)
66. [Minimize Maximum Value in a Grid](https://www.internhack.in/learn/dsa/problem/minimize-maximum-value-in-a-grid) (Hard)
67. [Minimum Cost Path with Teleportations](https://www.internhack.in/learn/dsa/problem/minimum-cost-path-with-teleportations) (Hard)
68. [Minimum Cost to Connect Two Groups of Points](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-connect-two-groups-of-points) (Hard)
69. [Minimum Cost to Make at Least One Valid Path in a Grid](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-make-at-least-one-valid-path-in-a-grid) (Hard)
70. [Minimum Falling Path Sum II](https://www.internhack.in/learn/dsa/problem/minimum-falling-path-sum-ii) (Hard)
71. [Minimum Moves to Move a Box to Their Target Location](https://www.internhack.in/learn/dsa/problem/minimum-moves-to-move-a-box-to-their-target-location) (Hard)
72. [Minimum Moves to Reach Target with Rotations](https://www.internhack.in/learn/dsa/problem/minimum-moves-to-reach-target-with-rotations) (Hard)
73. [Minimum Number of Days to Disconnect Island](https://www.internhack.in/learn/dsa/problem/minimum-number-of-days-to-disconnect-island) (Hard)
74. [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](https://www.internhack.in/learn/dsa/problem/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix) (Hard)
75. [Minimum Number of Visited Cells in a Grid](https://www.internhack.in/learn/dsa/problem/minimum-number-of-visited-cells-in-a-grid) (Hard)
76. [Minimum Obstacle Removal to Reach Corner](https://www.internhack.in/learn/dsa/problem/minimum-obstacle-removal-to-reach-corner) (Hard)
77. [Minimum Operations to Remove Adjacent Ones in Matrix](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-remove-adjacent-ones-in-matrix) (Hard)
78. [Minimum Time Takes to Reach Destination Without Drowning](https://www.internhack.in/learn/dsa/problem/minimum-time-takes-to-reach-destination-without-drowning) (Hard)
79. [Minimum Time to Visit a Cell In a Grid](https://www.internhack.in/learn/dsa/problem/minimum-time-to-visit-a-cell-in-a-grid) (Hard)
80. [Number of Distinct Islands II](https://www.internhack.in/learn/dsa/problem/number-of-distinct-islands-ii) (Hard)
81. [Number of Increasing Paths in a Grid](https://www.internhack.in/learn/dsa/problem/number-of-increasing-paths-in-a-grid) (Hard)
82. [Number of Paths with Max Score](https://www.internhack.in/learn/dsa/problem/number-of-paths-with-max-score) (Hard)
83. [Number of Submatrices That Sum to Target](https://www.internhack.in/learn/dsa/problem/number-of-submatrices-that-sum-to-target) (Hard)
84. [Number of Ways of Cutting a Pizza](https://www.internhack.in/learn/dsa/problem/number-of-ways-of-cutting-a-pizza) (Hard)
85. [Paths in Matrix Whose Sum Is Divisible by K](https://www.internhack.in/learn/dsa/problem/paths-in-matrix-whose-sum-is-divisible-by-k) (Hard)
86. [Rank Transform of a Matrix](https://www.internhack.in/learn/dsa/problem/rank-transform-of-a-matrix) (Hard)
87. [Shortest Distance from All Buildings](https://www.internhack.in/learn/dsa/problem/shortest-distance-from-all-buildings) (Hard)
88. [Shortest Path in a Grid with Obstacles Elimination](https://www.internhack.in/learn/dsa/problem/shortest-path-in-a-grid-with-obstacles-elimination) (Hard)
89. [Shortest Path to Get All Keys](https://www.internhack.in/learn/dsa/problem/shortest-path-to-get-all-keys) (Hard)
90. [Sliding Puzzle](https://www.internhack.in/learn/dsa/problem/sliding-puzzle) (Hard)
91. [Smallest Rectangle Enclosing Black Pixels](https://www.internhack.in/learn/dsa/problem/smallest-rectangle-enclosing-black-pixels) (Hard)
92. [Stamping the Grid](https://www.internhack.in/learn/dsa/problem/stamping-the-grid) (Hard)
93. [Strange Printer II](https://www.internhack.in/learn/dsa/problem/strange-printer-ii) (Hard)
94. [Sudoku Solver](https://www.internhack.in/learn/dsa/problem/sudoku-solver) (Hard)
95. [Swim in Rising Water](https://www.internhack.in/learn/dsa/problem/swim-in-rising-water) (Hard)
96. [The Maze III](https://www.internhack.in/learn/dsa/problem/the-maze-iii) (Hard)
97. [Transform to Chessboard](https://www.internhack.in/learn/dsa/problem/transform-to-chessboard) (Hard)
98. [Trapping Rain Water II](https://www.internhack.in/learn/dsa/problem/trapping-rain-water-ii) (Hard)
99. [Unique Paths III](https://www.internhack.in/learn/dsa/problem/unique-paths-iii) (Hard)
100. [Word Search II](https://www.internhack.in/learn/dsa/problem/word-search-ii) (Hard)

## Companies that ask matrix problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 79 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 58 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 44 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 35 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 31 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 16 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 13 of these problems
- [Zoho](https://www.internhack.in/learn/dsa/companies/zoho): 9 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 9 of these problems
- [Doordash](https://www.internhack.in/learn/dsa/companies/doordash): 8 of these problems
- [Snapchat](https://www.internhack.in/learn/dsa/companies/snapchat): 8 of these problems
- [Flipkart](https://www.internhack.in/learn/dsa/companies/flipkart): 8 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
