Let $J_{n \times n}$ be the all $1$'s matrix. Then find the eigenvalues of $J$.
I searched around the net, was able to find the following proof:
Proof. Clearly, $J$ has rank $1$. Hence there is one non-zero eigenvalue of $J$ equalto $n$. And other eigenvalue is $0$ with multiplicity $n-1$.
Question: How to find the the number of non-zero eigenvalues using the rank of a matrix, and how is it concluded to be $n$?
The rank is $1$, as the columns of the matrix are spanned by a single non-zero vector, specifically $$\operatorname{colspace}(J_{n \times n}) = \operatorname{span}\left\{\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}\right\}.$$ This implies the columnspace is $1$-dimensional, and this dimension is the rank (by definition.
The Rank-Nullity theorem implies that the nullspace of $J_{n \times n}$ is of $n - 1$ dimensions. The nullspace is the subspace of vectors $x$ such that $Jx = 0 = 0x$, which is to say, the eigenspace corresponding to $\lambda = 0$. This means, we may find $n - 1$ linearly independent eigenvectors for $J$.
So, now we are left with two possibilities. Either, we have another non-zero eigenvalue, or we have only $0$ as our eigenvalue, with multiplicity $n$. The latter possibility would mean that $J$ is not diagonalisable, but it could be a possibility considering only the previous calculations (this can be very quickly rejected, since $J$ is symmetric!).
At this point, we just need a good guess as to the eigenvalue, or indeed, an eigenvector. It's not hard to see that
$$\begin{bmatrix} 1 & 1 & \cdots & 1 \\ 1 & 1 & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & 1 \end{bmatrix}\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix} = n\begin{bmatrix} 1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}.$$
This confirms, by definition, that there is another eigenvalue: $n$. We now have the complete picture: there are two eigenvalues; $0$ with multiplicity $n - 1$ and $n$ with multiplicity $1$.