First let us note that since $\text{rank}(A)=1$, $0$ is an eigenvalue of $A$ of multiplicity $n-1$. Then the eigenvalues of $A$ must be $0,0,0,..,0, \text{tr}(A)$.

Therefore, since $\text{rank}(A)=1$, saying that we know the eigenvalues of $A$ is equivalent to saying that we know $\text{tr}(A)$.

Moreover, as $\text{tr}(A+B)=\text{tr}(A)+\text{tr}(B)=\text{tr}(A)$, the sum of eigenvalues of $A+B$ must be $\text{tr}(A)$.

Let $a_1,\cdots,a_n\in\mathbb{R}:a_1+\cdots+a_n =\text{tr}(A)$. Then, $a_1,\cdots,a_n$ are the eigenvalues of $A+B$, where

$$A= \begin{bmatrix} a_1 & a_1 & \cdots & a_1 \\
a_2 & a_2 & \cdots & a_2 \\
\vdots & \vdots & \ddots & \vdots \\
a_n & a_n & \cdots & a_n \end{bmatrix} \\
B= \begin{bmatrix} 0 & -a_1 & \cdots & -a_1 \\
-a_2 &0 & \cdots & -a_2 \\
\vdots & \vdots & \ddots & \vdots \\
-a_n & -a_n & \cdots &0\end{bmatrix} $$

Moreover, because of the above comments, $A$ has the given eigenvalues.

We finish by covering the case $a_1=\cdots=a_n=0$. They are eigenvalues of $A+B$, where
$$A= \begin{bmatrix} 0 & 0 & \cdots & 1 \\
0 & 0 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 0 \end{bmatrix} \\
B= 0 $$