Wayfair OA Interview Coding Question: Moving Day

17 Views
No Comments

Moving Day

Description

You and several roommates are coordinating a move out into several new apartments. Only two trucks of different sizes are available from a moving truck rental company. Imagine you are tasked with generating a solution that would figure out a trip plan for all roommates to transport their large and small items to their new homes.

What additional information will you need in order to solve this problem?

This Wayfair moving-day question is about planning truck trips under a capacity constraint. The key is to determine the missing inputs: truck capacities, how large and small items consume space, and whether the two item types can be mixed in the same trip. The provided code suggests a greedy simulation approach: fill each truck with as many large items as possible, then use the remaining capacity for small items, and repeat until all items are moved.

END
 0