  Superconductivity develops in bulk doped SrTiO$_3$ and at the
LaAlO$_3$/SrTiO$_3$ interface with a dome-shaped density dependence of the
critical temperature $T_c$, despite different dimensionalities and geometries.
We propose that the $T_c$ dome of LaAlO$_3$/SrTiO$_3$ is a shape resonance due
to quantum confinement of superconducting bulk SrTiO$_3$. We substantiate this
interpretation by comparing the exact solutions of a three-dimensional and
quasi-two-dimensional two-band BCS gap equation. This comparison highlights the
role of heavy bands for $T_c$ in both geometries. For bulk SrTiO$_3$, we
extract the density dependence of the pairing interaction from the fit to
experimental data. We apply quantum confinement in a square potential well of
finite depth and calculate $T_c$ in the confined configuration. We compare the
calculated $T_c$ to transport experiments and provide an explanation as to why
the optimal $T_c$'s are so close to each other in two-dimensional interfaces
and the three-dimensional bulk material.
