The spectrum is one of the basic information of any quantum field theory. In general, it is difficult to obtain the full quantum spectrum of QFT. However, in the case of four dimensional superconformal theories, certain information of the quantum spectrum can be extracted exactly. In such theories one can compute exactly certain observables containing spectral information with the help of localization technique. One such observable is the superconformal index, which is a partition function of the 4d theory on S<super>3</super> * S<super>1</super>, twisted by various chemical potentials. This index counts the states of the 4d theory belonging to short multiplets, up to equivalent relations that set to to zero all sequences of short multiplets that may in principle recombine into long ones. By construction, the index is invariant under continuous deformations of the theory. The superconformal index is studied for the class of N=2 4d superconformal field theories introduced by Gaiotto. These theories are defined by compactifying the (2,0) 6d theory on a Riemann surface with punctures. The index of the 4d theory associated to an n-punctured Riemann surface can be interpreted as the n-point correlation function of a 2d topological QFT living on the surface, which can also be identified as a certain deformation of two-dimensional Yang-Mills theory. With the help of different symmetric polynomials, even explicit formulae are conjectured for all A-type quivers of such class of theories, which in general do not have Lagrangian description. Besides the N=2 theories, the superconformal index of the N=1 Y<super>p,q</super> quiver gauge theories is also evaluated using R"omeslberger's prescription. For the conifold quiver Y<super>1,0</super> the result agrees exactly at large N with a previous calculation in the dual AdS<sub>5</sub> * T<super>1,1</super> supergravity. The superconformal index of a 4d gauge theory is computed by a matrix integral arising from localization of the supersymmetric path integral on S<super>3</super> * S<super>1</super> to the saddle point. As the radius of the circle goes to zero, it is natural to expect that the 4d path integral becomes the partition function of dimensionally reduced gauge theory on S<super>3</super>. We show that this is indeed the case and recover the matrix integral of Kapustin, Willett and Yaakov from the matrix integral that computes the superconformal index. Remarkably, the superconformal index of the "parent" 4d theory can be thought of as the q-deformation of the 3d partition function.