Pinterest·Software Engineer·Technical Phone Screen
- Given a list of group trip transactions where each transaction has a payer, a total amount, and a list of people splitting the cost equally, compute a minimal (or any valid) set of direct transfers that brings everyone's net balance to zero.
“I got the basic structure pretty fast: compute each person's net balance by adding what they paid and subtracting their share of each transaction.”