I recently interviewed with Kivi Capital for the Quant Researcher role. The first round lasted around 60 minutes and consisted of one algorithmic problem followed by several conceptual computer science questions.
You need to deliver N shipments. For each shipment, you may hire either Vendor X or Vendor Y.
Vendor X delivery times:
X = [x₁, x₂, …, xₙ]
Vendor Y delivery times:
Y = [y₁, y₂, …, yₙ]
Constraints:
Vendor X processes shipments sequentially
→ total time = sum of delivery times assigned to X
Vendor Y processes shipments in parallel
→ total time = maximum delivery time among shipments assigned to Y
Goal: Minimize the total completion time for delivering all shipments.
Let:
Then:
Total completion time:
max(t₁, t₂)
If xᵢ > yᵢ, assigning that shipment to Vendor Y is always beneficial since Y completes it faster.
For cases where xᵢ < yᵢ, the choice is non-trivial because:
For such shipments, create pairs (yᵢ, xᵢ) and sort them by yᵢ.
Consider partition points in this sorted list:
Compute:
Track the minimum value of:
max(yₖ, suffix_sum_x)
Time complexity: O(N log N) due to sorting.
After the algorithmic question, the interviewer asked several conceptual questions: