Solutions
There are 4 rows and 4 columns in the above figure. So let n = 4.
Here, we using formulas for finding number of squares in an n × n grid as follows.
Formula :-
n2 + (n - 1)2 + (n - 2)2 + - - - - - - - - - - + (n - n)2
The number of squares in a 4 × 4 matrix is
= 4² + 3² + 2² + 1²
⇒ 16 + 9 + 4 + 1 = 30
Theoretical Method:
To count the square, we will assign a number to each block of the square as shown below:

Sqaures involving only one block = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} = 16 squares
Squares involving four blocks = {(1, 2, 5, 6), (2, 6, 3, 7), (3, 7, 4, 8), (5, 6, 9, 10), (6, 7, 10, 11), (7, 8, 11, 12), (9, 10, 13, 14), (10, 11, 14, 15), (11, 12, 15, 16)} = 9 squares
Squares involving 9 blocks = {(1, 2, 3, 5, 6, 7, 9, 10, 11), (2, 3, 4, 6, 7, 8, 10, 11, 12), (5, 6, 7, 9, 10, 11, 13, 14, 15), (6, 7, 8, 10, 11, 12, 14, 15, 16)} = 4 squares
Squares involving 16 blocks = 1
Total number of squares = 16 + 9 + 4 + 1 = 30 squares.
So, there are 30 squares in the given figure.
Hence, the correct answer is "30".