Salesforce Onsite round
Summary
I was asked a partitioning problem during my Salesforce onsite interview.
Full Experience
Hi guys, I recently got this question in my Salesforce onsite round.
Given an array of campaign costs and number of weeks, partition the
campaigns optimally to minimize the sum of weekly maxima.
Sample test cases:
costs = [2, 5, 4, 3, 7, 1, 6, 8]
weeks = 3
Interview Questions (1)
Partition Campaign Costs to Minimize Weekly Maxima
Given an array of campaign costs and a number of weeks, partition the campaigns into the given number of weeks such that the sum of the maximum cost in each week is minimized.
Example:
costs = [2, 5, 4, 3, 7, 1, 6, 8]
weeks = 3
Find the optimal partitioning and the resulting minimized sum of weekly maxima.