A Matrix/Grid is a two-dimensional array that consists of rows and columns. It is an arrangement of elements in horizontal or vertical lines of entries. Here is the list of the top 50 frequently asked interview questions on Matrix/Grid in the SDE Interviews. Problems in this Article are divided into three Levels so that readers can practice according to the difficulty level step by step.
Refer to the Tutorial on Matrix/Grid to learn more about Matrix Data Structure.

Easy Problems
- Rotate Matrix Elements
- Sort the matrix
- Turn image by 90-degree
- Multiply two matrices
- Maximum element of each row in a matrix
- Count sorted rows in a matrix
- Common elements in all rows of matrix
- Print matrix in snake pattern
- Sort a Matrix in all way increasing order
- Row with maximum 1s
- Sums of diagonals of a matrix
- Array subset Check
- Boundary elements of a Matrix
- Magic square
Medium Problems
- Peak Element in 2D matrix
- Matrix Median
- Rotate matrix by 90 degree without extra space
- Rotate Matrix by 180 degree
- Rotate the matrix right by K times
- Print a given matrix in spiral form
- Zigzag (or diagonal) traversal of Matrix
- Spiral Traversal of Matrix
- Search in a Row Column Sorted Matrix
- Find the number of islands
- Boolean Matrix Question
- Count number of islands in a binary matrix
- Maximum sum rectangle in a 2D matrix
- Flood Fill Algorithm
- Count Paths in matrix
- Maximum path sum in matrix
- Rotate a matrix by 90 degrees
- Minimum steps to reach target by a Knight
- Minimum cost to fill the weight
- Shortest path in a Binary Maze
Hard Problems
- Largest binary sub-matrix with all 1s
- Largest rectangular area in histogram
- Find pair in a matrix
- Maximum size square sub-matrix with all 1s
- Largest rectangle of 1's with swapping of columns
- Maximum sum rectangular submatrix
- Minimum Points to Reach Destination
- Number of paths with at-most k turns
- Boolean Matrix
- Matrix Chain Multiplication
- Ancestor Matrix from a Given Binary Tree
- Print K’th element in spiral form of matrix
- Size of the largest ‘+’ in a binary matrix
- Maximum sum square sub-matrix of given size
- Tic-Tac-Toe Validity