The starting point for this work was the question whether every finite group G contains a two-generated subgroup H such that pi(H) = pi(G), where pi(G) denotes the set of primes dividing the order of G. We answer the question in the affirmative and address the following more general problem. Let G be a finite group and let i(G) be a property of G. What is the minimum number t such that G contains a t-generated subgroup H satisfying the condition that i(H) = i(G)? In particular, we consider the situation where i(G) is the set of composition factors (up to isomorphism), the exponent, the prime graph, or the spectrum of the group G. We give a complete answer in the cases where i(G) is the prime graph or the spectrum (obtaining that t = 3 in the former case and t can be arbitrarily large in the latter case). We also prove that if i(G) is the exponent of G, then t is at most four