In this paper we show that all finitely generated nilpotent, metabelian, polycyclic, and rigid (hence free solvable) groups G are fully characterized in the class of all groups by the set tp(G) of types realized in G. Furthermore, it turns out that these groups G are fully characterized already by some particular rather restricted fragments of the types from tp(G). In particular, every finitely generated nilpotent group is completely defined by its ∃+-types, while a finitely generated rigid group is completely defined by its ∀-types, and a finitely generated metabelian or polycyclic group is completely defined by its ∀∃-types. We have similar results for some non-solvable groups: free, surface, and free Burnside groups, though they mostly serve as illustrations of general techniques or provide some counterexamples.