Amazon interview question

Question about how to fill buckets.