The statistical mechanics of interfaces subject to quenched impurities is studied in two dimensions. The presence of randomness changes the scaling of domain wall fluctuations, and modifies critical behavior at interface-driven depinning (wetting), and commensurate-to-incommensurate phase transitions. All these problems are examined by combining the replica method with Bethe ansatz calculations. Results include expressions for quench-averaged free energies, their cumulants, expectation values, distribution functions, in addition to a number of new critical exponents. The intermediate results include some novel Bethe ansatz solutions, such as the ground state energy of a system of n attracting fermion species.