We present an approach to calculate indirect exchange interaction between paramagnetic ions via free carriers in heterostructures. Unlike well-known Ruderman–Kittel–Kasuya–Yosida (RKKY) theory the suggested method is not a perturbation theory and thus can be used in the wider variety of cases, especially when resonant effects are important. The method is applied to standard 1D and 2D indirect exchange problems. We further focus on calculation of indirect exchange interaction between two ions mediated by 2D free carriers gas separated by a tunnel barrier. The calculations show that if the ion bound state energy lies within the energy range occupied by the free 2D carriers, the indirect exchange interaction is strongly enhanced due to resonant tunneling and far exceeds what one would expect from the conventional RKKY approach.