(N/A) Let $A$ be the cross-sectional area of the bar perpendicular to the force $F$.
Consider a plane $aa'$ making an angle $\theta$ with the length of the bar. The area of this plane is $A' = A / \sin \theta$.
The force $F$ can be resolved into two components relative to this plane:
$1$. Normal force: $F_N = F \sin \theta$
$2$. Shear force: $F_S = F \cos \theta$
Tensile stress (normal stress) $\sigma = F_N / A' = (F \sin \theta) / (A / \sin \theta) = (F/A) \sin^2 \theta$.
Shearing stress $\tau = F_S / A' = (F \cos \theta) / (A / \sin \theta) = (F/A) \sin \theta \cos \theta = (F/2A) \sin(2\theta)$.
$(a)$ Tensile stress $\sigma = (F/A) \sin^2 \theta$ is maximum when $\sin^2 \theta = 1$,i.e.,$\theta = 90^\circ$.
$(b)$ Shearing stress $\tau = (F/2A) \sin(2\theta)$ is maximum when $\sin(2\theta) = 1$,i.e.,$2\theta = 90^\circ$ or $\theta = 45^\circ$.