It's not a very efficient solution (no one can move to the city for a job since you need somewhere to live within months then - not decades). It also needs very draconian rules to avoid a large black market in contracts.
There are no good solutions to this problem. If you are a socialist you argue that the lesser evil is inefficient queueing and if you are an economic liberal you argue that allocating via market prices is better and gentrification/segregation is the lesser evil.