Split a Parent Order Across Buckets Under Quadratic Impact

Last updated: November 29, 2026

Quick Overview

A parent order of Q shares must be split across T time buckets where executing x shares in bucket t costs a_t x + b_t x^2 / V_t and at most cap_t shares fit in the bucket; return the integer allocation that minimizes total cost.

Virtu Financial
Coding & Algorithms
Quantitative Researcher
Virtu Financial
November 29, 2026
Quantitative Researcher
Onsite
Coding & Algorithms
Hard

0

0

0 solved


A parent order of Q shares must be split across T time buckets where executing x shares in bucket t costs a_t x + b_t x^2 / V_t and at most cap_t shares fit in the bucket; return the integer allocation that minimizes total cost.

Virtu's agency algorithms (VWAP, participation, implementation shortfall) all decide how much to trade per interval given a volume forecast and an impact model. The question checks whether you recognize a separable convex problem, use marginal cost reasoning, and can turn a greedy idea into something that scales to millions of shares.

What the Interviewer Expects
  • Show the cost is separable and convex, so marginal costs per bucket are increasing
  • Argue a greedy on smallest marginal cost is optimal
  • Scale past O(Q log T) with water-filling: binary search on a marginal threshold
  • Fix ties exactly so the allocation sums to Q
  • Respect per-bucket participation caps and infeasible input
Key Topics to Cover
convex optimization
greedy exchange argument
binary search
water-filling
market impact
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How does the answer change with a linear risk penalty that prefers trading earlier?
  • What if impact in a bucket depends on what you traded in the previous bucket?
  • How would you re-plan intraday when the realized volume curve differs from forecast?
  • How would you validate the impact model parameters from Virtu's own fills?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs Q, and per bucket a_t, b_t > 0, forecast volume V_t, and cap cap_t. Output integer x_t with 0 <= x_t <= cap_t, sum x_t = Q, minimizing sum a_t x_t + b_t x_t^2 / V_t....

High-Level Design

The k-th share in bucket t costs m_t(k) = a_t + b_t(2k - 1)/V_t, increasing in k. Total cost is the sum of the chosen marginal costs, and since each bucket's sequence is increasing, any optimal solu...


Submit Your Answer
Markdown supported

Related Questions