  Interfacial superconductivity is observed in a variety of heterostructures
composed of different materials including superconducting and
nonsuperconducting (at appropriate doping and temperatures) cuprates and
iron-based pnictides. The origin of this superconductivity remains in many
cases unclear. Here, we propose a general mechanism of interfacial
superconductivity for systems with competing order parameters. We assume that
parameters characterizing the material allow formation of another order like
charge- or spin-density wave competing and prevailing superconductivity in the
bulk (hidden superconductivity). Diffusive electron scattering on the interface
results in a suppression of this order and releasing the superconductivity. Our
theory is based on the use of Ginzburg--Landau equations applicable to a broad
class of systems. We demonstrate that the local superconductivity appears in
the vicinity of the interface and the spatial dependence of the superconducting
order parameter~$\Delta(x)$ is described by the Gross--Pitaevskii equation.
Solving this equation we obtain quantized values of temperature and doping
levels at which~$\Delta(x)$ appears. Remarkably, the local superconductivity
shows up even in the case when the rival order is only slightly suppressed and
may arise also on the surface of the sample (surface superconductivity).
