How many different grid squares can be marked on an $n \times n$ square grid so that their sides are parallel to the sides of the grid?
In an $n \times n$ square, according to the conditions of the problem, squares with side lengths of $1,2,3, \ldots, n$ can be drawn.

The position of a $k \times k$ square can be uniquely determined, for example, by the coordinates of its top-left corner, which can be in $(n-k+1)$ different ways in both directions.

Thus, a $k \times k$ square can be placed in $(n-k+1)^{2}$ different ways.

Therefore, the total number of squares is:

$$
\sum_{k=1}^{n}(n-k+1)^{2}=n^{2}+(n-1)^{2}+(n-2)^{2}+\cdots+1^{2}=\frac{n(n+1)(2 n+1)}{6}
$$