I feel that we're very lucky in lots of ways, first in that I had help to buy my own 2 bedroom house when I was 29, and then that my mum and stepmother (dad's 2nd ex-wife!) helped to pay for the cost of a loft extension nearly 2 years ago.
Until then my sons shared a room, and had bunkbeds. They were 9.5 and 7, nearly 8 (21 month gap) when they moved upstairs to the new loft rooms. My sister bought them beds but ds2, now 9, still normally sleeps on the floor by choice.
The heating doesn't really work up there and for months from last autumn/winter until a few weeks ago, they were both sleeping in ds2's much larger bedroom which gets sunshine during the day, even winter sunshine, and he has a plug in radiator which can be put on to warm up the room for an hour or two before bdtime. DS2 didn't want DS1 to move back to his room and DS1 dithered about what he wanted.
There are advantages and disadvantages to them sharing and having their own bedrooms, and the present arrangement gives them some choice. We had the extension done because their old bedroom was really hardly big enough for one young DC and the idea of them sharing it as teenagers/young adults.... it's not clear how it would have worked but I suppose it would have had to! We are in London and they might need to live at home for a long time/forever, or move back home as adults, so hopefully we have the flexibility for them.
Many families don't have the option of moving rented or owned home to give everyone their own room. I think my house was built at the end of the 19th century, with a 2 storey extension probably in the 1970s to provide a small kitchen and large bathroom. I wonder how many people/children had to squeeze into it in its past, between c 1895 and 1982 (we bought in 1998 from a single woman who had lived there for 16 years).