Answer
a) $\approx 20\;\rm cm$
b) $2.43\;\rm m/s,\;3.71\;m/s$
Work Step by Step
a) According to Hooke's law;
$$F_{sp}=-kx$$
where $k$ is the spring constant and $x$ is the compressed or stretched distance.
Now when the rocket sits at rest on top of the spring, the net force exerted on the rocket is zero since the gravitational force (exerted downward) is equal to the spring force (exerted upward).
Thus,
$$F_{sp}=mg$$
Thus, from these two formulas,
$$-kx=mg$$
Hence, the compressed distance of the spring is given by
$$x=\dfrac{-mg}{k}$$
Plugging the known;
$$x=\left|\dfrac{-10.2\times 9.8}{500}\right|= 0.1999\;\rm m$$
$$x\approx \color{red}{\bf 20}\;\rm cm$$
---
b) In this case, we choose the system to be the spring+ the rocket+the Earth. Thus, we can apply the conservation of energy principle since we know that the thrust is doing work on our system.
Hence,
$$E_i=E_f$$
$$K_i+U_{ig}+U_{is}+W_{\rm thrust}=K_f+U_{fg}+U_{fs} $$
We chose the initial point to be our origin and we know that the rocket starts from rest. Thus,
$$0+0+U_{is}+W_{\rm thrust}=K_f+U_{fg}+U_{fs}$$
The work is given by $F_{\rm thrust}\Delta y$
$$\frac{1}{2}kx_1^2+F_{\rm thrust}\Delta y=\frac{1}{2}mv_1^2+mg\Delta y+\frac{1}{2}kx_2^2 $$
Solving for $v_1$;
$$v_1 =\sqrt{\dfrac{\frac{1}{2}kx_1^2+F_{\rm thrust}\Delta y-[mg\Delta y+\frac{1}{2}kx_2^2 ]}{\frac{1}{2}m}}$$
Plugging the known;
$$v_1 =\sqrt{\dfrac{\frac{1}{2}(500)(0.2)^2+(200 )(0.6)-[(10.2)(9.8)(0.6)+\frac{1}{2}(500)(0.4)^2]}{\frac{1}{2}(10.2)}}$$
$$v_1=\color{red}{\bf 2.43}\;\rm m/s$$
$\Rightarrow$ in the other case, when the spring no longer touches the rocket, we can use the same approach above but replace the final elastic potential energy with zero rather than $\frac{1}{2}kx_2^2$.
Thus,
$$v_1' =\sqrt{\dfrac{\frac{1}{2}kx_1^2+F_{\rm thrust}\Delta y-[mg\Delta y+0 ]}{\frac{1}{2}m}}$$
Plugging the known;
$$v_1' =\sqrt{\dfrac{\frac{1}{2}(500)(0.2)^2+(200 )(0.6)-[(10.2)(9.8)(0.6) ]}{\frac{1}{2}(10.2)}}$$
$$v_1'=\color{red}{\bf 3.71}\;\rm m/s$$