Wayfair interview question

Simple Java problem, database and system design