Net Intercompany Payment Obligations Into Minimal Settlement Transfers

Last updated: November 29, 2026

Quick Overview

Given a list of obligations (payer, payee, amount) between legal entities, compute net positions and output a list of transfers that settles everything using at most one fewer transfer than the number of entities with a non-zero balance.

Deutsche Bank
Coding & Algorithms
Software Engineer
Deutsche Bank
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given a list of obligations (payer, payee, amount) between legal entities, compute net positions and output a list of transfers that settles everything using at most one fewer transfer than the number of entities with a non-zero balance.

Netting is central to Deutsche Bank's treasury and cash management products, where corporate clients and the bank's own entities reduce the number and size of cross-border payments. The technical screen checks whether the candidate separates the netting step from the transfer step and can reason about the greedy bound.

What the Interviewer Expects
  • Reduce gross obligations to a single net balance per entity
  • Explain that net balances sum to zero
  • Use a greedy debtor to creditor pairing with heaps or sorting
  • Prove each transfer zeroes at least one entity, giving at most k minus 1 transfers
  • Note that true minimum transfer count is NP-hard
Key Topics to Cover
Hash maps
Greedy algorithms
Heaps
Netting
Treasury payments
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 would you find the true minimum number of transfers for small inputs?
  • Obligations are in different currencies: how does netting change?
  • How would you make the result deterministic for audit purposes?
  • How would you handle an entity that is not allowed to pay a specific other entity because of regulation?
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

Input: list of (payer, payee, amount) with positive integer amounts in one currency (use integer cents). Output: transfers (from, to, amount) such that after applying them every entity's net posit...

High-Level Design
  1. Netting: for each obligation subtract from payer, add to payee. Balances sum to zero.
  2. Split into debtors (negative) and creditors (positive), ignore zeros.
  3. Repeatedly take the largest debtor ...

Submit Your Answer
Markdown supported

Related Questions