The Dorm Prevention

The Dorm Prevention is a concept created by the founders of Hogwarts in order to prevent boys entering the girls dormitories, or vice versa.

Gryffindor
Gryffindor utilizes a charm that turns the girls' staircase into a slide.

Hufflepuff
Whilst the Hufflepuff doesn't have a portrait guarding the entrance to the Common Room, there are two guarding the entrance to the male and female dormitories. In order to gain entrance to the opposite gender's dorm, the student must ask permission from the portrait, which will go to an empty frame and check in with the designated student. Students are not allowed in one another's dorm past curfew.

Ravenclaw
Similarly to Gryffindor, only the female dorms are guarded by a patch of Devil's Snare. If a male attempts to enter staircase leading to the female dormitories, the Snare will wrap around his body and hold him there until the Head Boy or Girl let him go. This frequently means the entirety of the Ravenclaw House is notified of the culprit.

Slytherin
Despite telling the other Founders that he would take part in the Dorm Prevention, Salazar Slytherin actually included no barriers to either dorm. There has been some speculation by The Marauders and Sanguine Sisters as to why that may be; some theories include that he believed that Slytherins should learn to handle untrustworthy acts by themselves, that he believed there would be no incidents, or that perhaps he wanted all of the students to easily be able to access one another in private settings for reasons other than intimacy.