The president answered questions about Russia’s anti-gay law and U.S. surveillance programs.