Answer
(a) 10
(b) 8
Work Step by Step
(a) We know that the 3d subshell is further divided into $3d_{xy},3d_{yz},3d_{x^2-y^2},3d_{z^2}$ and $3d_{xz}$ and each of them can occupy 2 electrons. Thus, 3d can hold 10 electrons.
(b) We know that for n=2 l=n-1=1
For n=2 and l=0, the 2s orbital can hold 2 electrons.
For n=2 and l=1, the 2p orbital can hold 6 electrons.
Hence, in total n=2 can occupy 8 electrons.