Naked Apartments interview question

How would you refactor this small program?