Another note - mostly in skyrim i notice, the cities have only a few houses and many chapels, castles, shops etc. I dont see where all the people sleep... unless the guard tower had 50 beds....
The guards all sleep in the barracks (there are infinite guards so it can't really be said that each one has their own bed) in the castles/keeps. In general, buildings have a higher average NPC count than previous games (which is a more accurate representation of medieval life, but still a shame as it makes cities very small), for example, houses owned by clans usually hold at least 4 people. I don't know about every city, but I know Riften has a fair few people living in the slums in the sewers, and there are a whole lot of them in Helga's bunkhouse. Some also sleep in inns, or the shops they own.