If your staying alone in a room, or even with another person a good way to make sure no one is getting in while your sleeping is to go to the hardware store and pick up a door stop for 50 cents. When you go to bed, stick thins thing under the door and it will not be able to be opened from the outside. ( For this to work your door must swing in).
This is good for private rooms in hostels, hotel rooms, private rooms in peoples homes...where ever....
there are fancy ones that have alarms built in, but they cost more $$$