TITLE: Variety of nilpotent Lie algebras or $p$-groups
QUESTION [13 upvotes]: Here's a couple of analogous questions, one in terms of finite-dimensional complex Lie algebras and one in terms of finite $p$-groups; I'd be interested in an answer to either:
1) Let $\mathcal{L}$ be an isomorphism-closed class of finite-dimensional nilpotent complex Lie algebras. Assume $\mathcal{L}$ is closed under taking finite direct products, subgroups, and quotients. Assume that it does not satisfy any common identity (i.e., any free Lie algebra is residually-$\mathcal{L}$). Does $\mathcal{L}$ necessarily consist of all finite-dimensional nilpotent complex Lie algebras?
2) Let $p$ be prime. Let $\mathcal{C}$ be an isomorphism-closed class of finite $p$-groups. Assume $\mathcal{C}$ is closed under taking finite direct products, subgroups, and quotients. Assume that it does not satisfy any common identity (i.e., any free group is residually-$\mathcal{C}$, or still equivalently the free group on 2 generators is residually-$\mathcal{C}$). Does $\mathcal{C}$ necessarily consist of all finite $p$-groups?
(Note: I ask both questions in the positive but I don't particularly expect a positive answer!)

REPLY [6 votes]: Here is some idea, it is not very precise. Let $F$ be the free group on two generators and let $F_p$ be its pro-$p$ completion. Let $w$ be an infinite word in $F_p$, i.e., an element of $F_p$ which is not in $F$. Let $W$ be the closed verbal subgroup of $F_p$ generated by $w$. I think that it is possible to choose $w$ so that $W \cap F$ is trivial. For example, the first congruence subgroup of $SL_2(\mathbb{Z}_p)$ ($p>2)$ satisfies a pro-$p$ identity due to Zubkov, but I think it has a dense free group. 
Let $D_n$ be the $n$-dimension subgroups of $F_p$. Then if I recall correctly there is a canonical way to write $w=w_nu_n$, where $u_n \in D_n$. Take your variety to be all the groups that satisfy $w_n$ for some $n$. I would guess they will satisfy your requirement.
I am not sure this idea will work, but if you like it and need more reference, then please contact me.