Minimize Intercompany Settlement Payments Across Group Entities
Last updated: November 29, 2026
Quick Overview
A corporate group has many intercompany balances between legal entities. Compute the minimum number of payments needed to settle every entity's net position, and return one settlement plan achieving it.
PwC
November 29, 20260
0
0 solved
A corporate group has many intercompany balances between legal entities. Compute the minimum number of payments needed to settle every entity's net position, and return one settlement plan achieving it.
Intercompany netting and eliminations come up constantly in PwC consolidation, treasury and tax advisory engagements, where fewer cross-border payments mean lower fees and fewer transfer pricing documents. The onsite problem checks whether a candidate sees past the greedy heuristic to the zero-sum subset structure and can implement a bitmask DP.
What the Interviewer Expects
- Reduce raw balances to one net position per entity
- Recognize that a zero-sum group of k entities settles in exactly k minus 1 payments
- Maximize the number of disjoint zero-sum groups with a subset DP
- Reconstruct an actual payment plan, not just the count
- State the exponential complexity and when it is acceptable
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 does pairing the largest debtor with the largest creditor not always give the minimum?
- How would you scale this to 500 entities where exact search is infeasible?
- How would you add a constraint that some entity pairs cannot transact due to currency controls?
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) balances. Output: the minimum count of payments and a list of (from, to, amount) that zeroes every entity. Entities with zero net position can be ignored. Amoun...
High-Level Design
Net everything first: each entity has one signed balance, summing to zero overall. Any group of entities whose balances sum to zero can always be cleared with payments (chain debtors to cr...