Answer
a) $1231\;\rm line/mm$
b) $46.5^\circ$
Work Step by Step
$$\color{blue}{\bf [a]}$$
We need to design a diffraction grating that makes the angle between the $m=1$ of the 400 nm diffracted light and the $m=1$ of the 700 nm diffracted light is 30$^\circ$.
This means that when the diffracted angle of the 400 nm is $\theta$, then the diffracted handle of the 700 nm light is then $(\theta+30^\circ)$.
Recalling that, in a diffraction grating, at $m=1$,
$$d\sin\theta=\lambda$$
Hence, for the 400 nm,
$$d\sin\theta =400\tag 1$$
And for the 700 nm,
$$d\;\overbrace{\sin(\theta+30^\circ)}^{\sin\theta\cos30^\circ+\sin30^\circ\cos\theta} =700 $$
$$d (\sin\theta\cos30^\circ+\sin30^\circ\cos\theta) =700 $$
Recalling that $(\sin\theta^2+\cos\theta^2=1)$, so $(\cos\theta=\sqrt{1-\sin\theta^2})$
$$d (\sin\theta\cos30^\circ+\sin30^\circ\sqrt{1-\sin\theta^2}) =700 $$
Plugging $\sin\theta$ from (1);
$$d\left[\dfrac{400}{d} \;\cos30^\circ+\sin30^\circ\sqrt{1-\dfrac{400^2}{d^2}} \right]= 700 $$
$$d\left[\dfrac{400}{d}\dfrac{\sqrt3}{2}+\dfrac{1}{2}\sqrt{1-\dfrac{400^2}{d^2}} \right]= 700 $$
$$ 200\sqrt3 +\dfrac{d}{2}\sqrt{1-\dfrac{400^2}{d^2}} = 700 $$
$$ d\; \sqrt{1-\dfrac{400^2}{d^2}} = 2(700 -200\sqrt3 )$$
Squaring both sides;
$$ d^2\left[1-\dfrac{400^2}{d^2 }\right] = 4(700 -200\sqrt3 )^2$$
$$ d^2 - 400^2 = 4(700 -200\sqrt3 )^2$$
$$ d =\sqrt{ 4(700 -200\sqrt3 )^2+400^2 }=\bf 812.5\;\rm nm$$
Hence,
$$N=\dfrac{1}{d}=\dfrac{1}{812.5\times 10^{-9}}=\bf 1.231\times 10^6\;\rm line/m$$
Therefore,
$$N=\color{red}{\bf 1231}\;\rm line/mm$$
$$\color{blue}{\bf [b]}$$
$$d\sin\theta_m=m\lambda$$
and for the first-order diffraction, $m=1$
$$d\sin\theta_1= \lambda$$
Hence,
$$\theta_1=\sin^{-1}\left[ \dfrac{\lambda}{d}\right]$$
Plugging $d$ from part a) above, and $\lambda$ from the given;
$$\theta_1=\sin^{-1}\left[ \dfrac{589}{812.5}\right]$$
$$\theta_1=\color{red}{\bf 46.5^\circ}$$