To have $30$ networks(sub-networks actually), we have to borrow $\left \lceil log_{2}(30) \right \rceil=5$ bits from the host id part of the subnet mask.
In class B addressing, $16$ bits each are reserved for network and host id part. Out of the $16$ host id bits, borrowing $5$ bits would result into a total of $(8+8+5=21)$ $1's$ and $11$ $0's$ in the subnet mask.
Subnet mask would be: $11111111.11111111.11111000.00000000$ i.e. $255.255.248.0$ with total of $2^{11}$ hosts, which is maximum because if more number of bits are chosen for subnet id part, less would the number of bits availalbe for host id part.
Option D is correct.