LinkedIn | Phone Interview | Senior SE
Anonymous User
2605

I was asked the following question during my phone interview:
Given a start, duration, and volume (of commodity that the user will buy) for the calls at a call center, maximize the total volume such that the calls don't intersect.

Eg 1: start = [1, 5, 10], duration = [1, 4, 10], volume = [1, 10, 20],
return max_volume=31
Call duration is [start[i], start[i] + duration[i]]
Explanation: call duration could be [1, 2], [5, 9], [10, 20] and since all the calls can be made independently, the total volume is 31.

Eg 2: start = [5, 5, 15, 20, 30], duration = [35, 12, 20, 35, 35], volume = [50, 75, 20, 25, 10],
return max_volume=100
Explanation: call duration could be [5, 40], [5, 17], [15, 35], [20, 55], [30, 65]. Since we see that the calls could intersect, we will pick [5, 17] and [20, 55] to maximize volume.

Eg 3: start = [5, 5, 15, 20, 30], duration = [35, 10, 20, 35, 35], volume = [50, 10, 20, 25, 10],
return max_volume=75
Explanation: call duration could be [5, 40], [5, 15], [15, 35], [20, 55], [30, 65]. Since we see that the calls could intersect, we will pick [5, 40] and [20, 55] to maximize volume.

I couldn't solve it completely and hence got a rejection.

Comments (6)