Back to problems

Bucket Batching DP (Applied Scientist Phone Screen)

Algorithm · Amazon · Hard

Requirements You are given document lengths L[0..K-1], all positive integers, and a GPU count G. First sort L in ascending order, then divide the documents into exactly G contiguous buckets. For a bucket, calculate its cost as (number of documents in the bucket) * (largest document length in that bucket). Find the minimum possible sum of the bucket costs. The optimal buckets, or equivalently their partition boundaries, must also be recoverable. You may maintain a parent…

Checking your access…