It worked pretty well in the USSR - housing was generally not a problem. Heck even after the collapse of the USSR economy, people still had a place to live. Can you imagine how hellish it would be if it happened in the US , when everything is private and most don't own?
What are you even talking about? Apartments in USSR were infamously hard to get, and even now, significant part of tge population lives in dorms, communal apartments or in buildings too dangerous to live in. Plus, USSR has a long tradition of several generations of the same family living in the same apartment together, a room per family.