We investigate the possibilities of using measurements in present and future experiments on heavy ion collisions to answer some longstanding problems in hadronic physics, namely identifying hadronic molecular states and exotic hadrons with multiquark components. The yields of a selected set of exotic hadron candidates in relativistic heavy ion collisions are discussed in the coalescence model in comparison with the statistical model. We find that the yield of a hadron is typically an order of magnitude smaller when it is a compact multiquark state, compared to that of an excited hadronic state with normal quark numbers. We also find that some loosely bound hadronic molecules are formed more abundantly than the statistical model prediction by a factor of two or more. Moreover, due to the significant numbers of charm and bottom quarks produced at RHIC and even larger numbers expected at LHC, some of the proposed heavy exotic hadrons could be produced with sufficient abundance for detection, making it possible to study these new exotic hadrons in heavy ion collisions.