1)
How did they know which girls were virgins?
1.
Rashi (12, citing Yevamos 60b): They put the girls on a barrel of wine. A Be'ulah, the smell of wine [goes through her body and] exudes from her mouth, but not for a virgin, [the Besulim block the smell]. Radak - They did not use the Tzitz, which is "l'Ratzon Lahem" - for Yisrael, it makes Hashem pleased with them, and it is not for punishment.
2.
Radak: Perhaps they passed them in front of the Aron. Anyone whom the Aron absorbed, she is a Besulah. This is like they did with Benos Midyan (to know who was old enough for Bi'ah); they passed them in front of the Tzitz, and a Be'ulah, her face turned yellow (Yevamos 60b).