Calling $a = n-1,q_{A}(f),p_{A}(t)$ the minimal and characteristic polynomial respectively we can notice that $$p_{A}(t) = det(A-tId) = \begin{bmatrix}-t & 0 & ... 0 && \alpha_{1} \\ 0 & -t & ... 0 && \alpha_{2} \\ . \\ . \\ . \\ 0 & 0 &... 0 && a-t\end{bmatrix} = (-1)^{n-1}t^{n-1}\cdot(a-t)$$
Since $A$ is upper triangular.
From the primary decomposition theorem we know that $V = Ker' f \bigoplus V_{a}$ where $V_{a}$ represent the general Eigenspace of eigenvalue $a$.
Knowing that $q_{A}(t) \mid p_{A}(t)$ due to Hamilton-Cayley theorem, we can assert that $q_{A}(t) = (t-a)\cdot t^{k}$ where $1 \leq k \leq n-1$
Since the Eigenspace are invariant subspaces we can restrict our view to $V_{a}$ and $Ker f$.
Note that studying $V_{a}$ is quite irrelevant because from the algebric-geometric multiplicity inequality ($1 \leq m_{g} \leq m_{a}$) we know that $f$ restricted to $V_{a}$ is diagonalizable.
Studying $Ker f$ we know that $dim Ker f = n-1 \iff (\alpha_{1},\cdots,n-1) \ne (0,\cdots,0)$ we're gonna study this second case where $(\alpha_{1},\cdots,n-1) = (0,\cdots,0)$ separately.
In the first case we've almost done because we possess all the notion of the Jordan normal form of $A$ which gives us the minimal polynomial very easily.
$$J(A) = \begin{bmatrix}0 & 0 & ... 0 && 0 \\ 0 & 0 & ... 0 && 0 \\ . \\ . \\ . \\ 0 & 0 &... 0 && a\end{bmatrix} $$
Which leads to $q_{A}(t) = t \cdot (t-a)$ because the minimal polynomial is invariant under the conjugacy-relation.
Note that if $n=1$ so $a=0$ the minimal polynomial is $t^{2}$.
In the second case $(\alpha_{1},\cdots,n-1) = (0,\cdots,0)$ we have that $A=0$ course diagonalizable, which brings in this case to $p_{A}(t) = (-1)^{n}t^{n}, q_{A}(t) = t$