Just as context, this problem arose when I was looking at the adjacency matrices of moore graphs of diameter 2.
Given that $I$ is the identity matrix and $J$ is the all 1 matrix. I have constructed some matrix $aI + bJ$. I am completely stuck in terms of how to find the eigenvalues of this matrix. I have considered trying to find the characteristic polynomial, but I have no idea how I would find the determinant of such a matrix.
Write $A = aI+ bJ$. Note that $A-aI = bJ$ has rank 1, so the eigenvalue $a$ has geometric multiplicity $n-1$.
So all that’s left to do is find the other eigenvalue. Trying $\lambda=a+nb$ gives that $A-\lambda I$ has diagonal entries $(1-n)b$ and all other entries $b$. In particular, the sum of all the rows is the zero vector, so this matrix is singular.
Edit: I should note it is assumed here that $b\ne 0$. If $b=0$, then $A-aI=bJ$ is the zero matrix, which has rank 0, so $A$ has eigenvalue $a$ with multiplicity $n$.