Stripe·Software Engineer·Technical Phone Screen
- Given a list of transactions where each entry moves an amount from one user to another, process them in order with an overdraft rule: if applying a transaction would bring the sender's balance below zero, reject it and track it separately. After processing everything, return the rejected transactions and all users with a non-zero final balance. All balances start at zero.
“My first instinct was to reach for something fancy and I wasted a couple minutes thinking about it before realizing this is just a hashmap and a loop.”