Pious believer should avoid mixing with other gender without necessity. Protecting self from sinful thought and acts is more important than any other in our life. It is allowed to study or work in a mixed places but with utmost care to protect yourself from any sinful thought or act.
Wassalam.