As regards the question, Dr. Hatem Al-Haj, dean of the Shari`ah Academy of America, stated,
Intermingling is a general term, which includes that which is permissible and that which is prohibited.
If it is merely men and women gathering in an open space to perform shared work, whether religious or non-religious, that in itself is not prohibited, as long as the Islamic code of behavior is followed, in terms of Hijab, lowering the gaze, and the like.
Women must keep away from men and vice versa as much as possible.
If mingling is about men and women socializing and mixing together closely and freely, this follows the basic principle of prohibition, as long as there is no exigent need according to the criteria of Shari`ah.
the prohibition of free mixing, particularly between people of young age is based on many proofs, of them, the following:
the Saying of Allah, “And stay in your houses, and do not display yourselves like that of the times of ignorance, and perform As-Salat (Iqamat asSalat), and give Zakat and obey Allah and His Messenger. Allah wishes only to remove Ar-Rijs (evil deeds and sins, etc.) from you, O members of the family (of the Prophet SAW), and to purify you with a thorough purification. (Al-Ahzab 33:33)
If settling at homes to prevent fitnah is obligatory on the Mothers of the Believers, since the address is firstly directed to them, the generality of ‘illah “effective cause of ruling” in Allah’s saying, “to remove Ar-Rijs from you” indicates that others are included, for Allah is not pleased with sins for any believing woman.
On the authority of Abi Hurairah (may Allah be pleased with him), he said, “Allah’s Messenger (may Allah bless him and grant him peace) said: ‘The best of the men’s rows are the first and the worst are the last, while the best of the women’s rows are the last and the worst are the first.’”
al-Nawawi (may Allah have mercy on him) said: “Indeed, the last rows of the women attending [the prayer] with the Messenger were preferred due to their distance from intermingling with men, and the criticism of the first rows is the opposite.”
the Messenger (may Allah bless him and grant him peace) said: “I have not left after me any fitnah (trial) more harmful to men than women.”
In the hadith, enough deterrence which would make anyone concerned about his faith avoid places of ruin and seek refuge in the fortress of pious caution.