> top floors were the least desirable. Poorer residents occupied the upper story.

This remained true in Western cities until elevators became widespread in the late 1800s. In New York city, for example, buildings didn't reach above 6 floors because even the poorest people would not walk up more stairs. Street level was frequently retail space, next floor up might be office space, everything higher was residential. Until Otis showed how to make a safety brake.

https://en.wikipedia.org/wiki/Elisha_Otis