Step 1: Resolve the initial velocity into components.
The ball is projected with speed
\[
u=20\ \text{m s}^{-1}
\]
at an angle
\[
30^\circ
\]
to the horizontal.
The vertical component of the initial velocity is
\[
u_y=u\sin30^\circ
\]
\[
u_y=20\times \frac{1}{2}
\]
\[
u_y=10\ \text{m s}^{-1}.
\]
Step 2: Take upward direction as positive.
Let the height of the building be \(h\).
The ball reaches the ground after
\[
t=3\ \text{s}.
\]
The vertical displacement from the point of projection to the ground is
\[
s=-h.
\]
Using the equation
\[
s=u_y t+\frac{1}{2}at^2,
\]
where
\[
a=-g=-10\ \text{m s}^{-2},
\]
we get
\[
-h=(10)(3)+\frac{1}{2}(-10)(3)^2.
\]
Step 3: Simplify the equation.
\[
-h=30-5(9).
\]
\[
-h=30-45.
\]
\[
-h=-15.
\]
Therefore,
\[
h=15.
\]
Step 4: Verify the result.
The ball initially rises due to the upward component of velocity and then falls under gravity. The net vertical displacement after \(3\) s is
\[
-15\ \text{m},
\]
which means the ground is \(15\) m below the point of projection.
Hence the building height is correctly obtained as \(15\) m.
Step 5: Final conclusion.
Therefore, the height of the building is
\[
\boxed{15\ \text{m}}
\]
Hence, the correct option is
\[
\boxed{(2)}
\]