First of all, the same university has multiple campuses. If you choose different departments and majors, you may not be in the same campus, or you may be in two places in the same city. Second, in the same campus, the time, place and courses arranged by different majors are different. Maybe you have to attend your own class at the same time, but when there is no class, you can go to your good friend's class to accompany him. In fact, apart from class time, as long as you are in the same campus, you can spend a lot of time together, and the university is very free. Third, the possibility that you have different majors together is that when you choose public elective courses, you choose the same course and can take classes together, but there are not many public elective courses.
Out of society, I don't know.