← Questions

Settle group debts with the fewest transfers

0
StripeAmazonCodingLast asked Nov 2026

A coding interview question asked in Amazon's coding round and at Stripe, last asked Nov 2026. It tests backtracking, recursion and hash map.

A group of friends shared costs, and the record of who owes whom is a list of debts (debtor, creditor, amount). Return the smallest number of money transfers that settles every debt, so that everyone's net balance ends at zero.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Amazon · Coding · Last asked Nov 202655 min · Usually two rounds; one is often an object-oriented design built in steps · No AI
  • Stripe · Technical phone screen · Last asked Feb 202660 min · One realistic task in parts, in a project editor (CoderPad project mode or HackerRank Projects) with several files and tests

What it tests

backtracking · recursion · hash map

Your code and the AI tutor open when you unlock this question.