Roofstock interview question

How would you structure your code for this layout?