Let $a,b,c,d,e,f$ be complex numbers.
$$A = \left( \begin{array} { c c c c } { 2 } & { a } & { b } & { c } \\ { 0 } & { 2 } & { d } & { e } \\ { 0 } & { 0 } & { 2 } & { f } \\ { 0 } & { 0 } & { 0 } & { 3 } \end{array} \right)~, \qquad B = \left( \begin{array} { c c c c } { 2 } & { 1 } & { 0 } & { 0 } \\ { 0 } & { 2 } & { - 1 } & { 0 } \\ { 0 } & { 0 } & { 2 } & { 1 } \\ { 0 } & { 0 } & { 0 } & { 3 } \end{array} \right)$$
I wonder the following:
Can the fact that "rank of A and B are equal" be of use to solve this problem?
Is there an easy way to solve such problems?
The matrices are similar iff they have the same Jordan normal form.
That is, iff they have the same eigenvalues, and the sizes of the Jordan blocks are the same as well.
Since both $A$ and $B$ are triangular, they have their eigenvalues on their diagonal. And they are the same. That is, eigenvalue $\lambda_1=2$ with algebraic multiplicity 3, and eigenvalue $\lambda_2=3$ with multiplicity 1.
Since $\text{nullity}(B-2I)=1$, the Jordan normal form of $B$ is: $$B\sim \begin{pmatrix}2&1\\&2&1\\&&2\\&&&3\end{pmatrix}$$
So in this case $A$ is similar to $B$ iff $\text{nullity}(A-2I)=1$, because then it has the same Jordan normal form. This is the case iff $$A-2I = \begin{pmatrix}0&a&b&c\\&0&d&e\\&&0&f\\&&&3\end{pmatrix}$$ has 3 independent columns. It is the case iff $a\ne 0$ and $d\ne 0$.
Therefore $A$ and $B$ are similar iff $a\ne 0$ and $d\ne 0$. The other letters are not relevant.
Note that it becomes more complicated if the eigenvalue $\lambda_1=2$ in $B$ has more than one Jordan block. Because then we have to distinguish between 2 and 3 Jordan blocks for eigenvalue $\lambda_1=2$.