The given charge assembly can be represented using the three co-ordinate axes $x , y$ and $z$ as shown in figure.
The charge $-2 q$ is placed at the origin $O$.
One $+ q$ charge is place at $( a , o , o )$ and the other $+ q$ charge is placed at $( o , a , o )$.
Thus the system has two dipoles along $x$-axis and $y$-axis respectively.
As the electric dipole moment is directed from the negative to the positive charge hence the resultant dipole moment will be along OA where coordinates of point $A$ are $( a , a , o )$.
The magnitude of each dipole moment, , $p = qa$
So, the magnitude of resultant dipole moment is
$P _{ R }=\sqrt{ p ^{2}+ P ^{2}}=\sqrt{( qa )^{2}+( qa )^{2}}=\sqrt{2} qa$