Compute Minimal Settlement Transfers After Multilateral Netting
Last updated: November 29, 2026
Quick Overview
Given a list of interbank obligations (payer, payee, amount), compute each bank's net position and output a list of settlement transfers that clears every position using at most n minus 1 transfers.
Citi
November 29, 20260
0
0 solved
Given a list of interbank obligations (payer, payee, amount), compute each bank's net position and output a list of settlement transfers that clears every position using at most n minus 1 transfers.
Netting is how clearing systems such as CHIPS, which Citi's 24/7 USD clearing builds on, cut the liquidity banks need to settle. The interviewer looks for the insight that only net positions matter, a correct greedy settlement, and awareness that the truly minimal count is NP-hard.
What the Interviewer Expects
- Collapse gross obligations into net positions per participant
- Prove net positions sum to zero
- Greedily match largest debtor with largest creditor
- Bound the transfer count by n minus 1
- Use integer amounts
- Mention that the exact minimum is a subset-sum style hard problem
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Why is the exact minimum number of transfers NP-hard, and when would you still compute it?
- How would you net per currency and then settle across currencies?
- How does netting change intraday liquidity needs versus gross real-time settlement?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: (payer, payee, amount_cents) triples. Output: transfers (from, to, amount) such that after applying them every participant's net is zero. Aim for few transfers; guarantee at most n minus 1 ...
High-Level Design
Gross obligations are irrelevant once netted: bank A owing B 100 and B owing C 100 is the same as A owing C 100 for settlement purposes. So:
- Compute
net[x] = received - paid. These sum to zero. 2...