Wayfair interview question

Simple hashmap, hashset type of problem.