We analyze exact conformal invariance of string worldsheet theory in non-trivial backgrounds using hamiltonian framework. In the first part of this talk we consider the example of type IIB superstrings in Ramond-Ramond pp-wave background. In particular, we discuss the quantum definition of energy-momentum (EM) tensor and two methods of computing Virasoro algebra. One of the methods uses dynamical supersymmetries and indirectly establishes (partially) conformal invariance when the background is on-shell. We discuss the problem of operator ordering involved in the other method which attempts to compute the algebra directly. This method is supposed to work for off-shell backgrounds and therefore is more useful. In order to understand this method better we attempt a background independent formulation of the problem which is discussed in the second half of the talk. For a bosonic string moving in an arbitrary metric-background such a framework is obtained by following DeWitts work (Phys.Rev.85:653-661,1952) in the context of particle quantum mechanics. In particular, we construct certain background independent analogue of quantum Virasoro generators and show that in spin-zero representation they satisfy the Witt algebra with additional anomalous terms that vanish for Ricci-flat backgrounds. We also report on a new result which states that the same algebra holds true in arbitrary tensor representations as well.