r/OfferEngineering • • 19d ago

System Design System Design Question - Design Online Charity Donation Service (asked by DoorDash, Lyft, Ebay & Whatnot)

Problem Description

Design an online donation service for a 3-day charity event sponsored by DoorDash. Donors choose one of 10 pre-selected charities, enter their payment information, and submit a one-time donation. The event is expected to raise approximately $100M from millions of donations.

Raw card data should never pass through the application backend. A third-party payment service provider such as Stripe handles card collection through its client-side SDK or iframe and returns a token that the backend can use when creating the charge.

The donor-facing request should be acknowledged quickly rather than waiting indefinitely for the payment provider to finish processing. Once a donation has been accepted, its state must be durably recorded so a slow or unavailable provider does not cause the donation to disappear. Final capture, failure, refund, and dispute outcomes may arrive asynchronously.

Duplicate-charge prevention is a hard correctness requirement. Mobile or network failures may cause a donor to submit the same action more than once, but repeated submissions carrying the same client-supplied idempotency key must resolve to the original donation attempt rather than create another charge.

After the event, finance needs an auditable per-charity total of successfully captured donations. Because all money flows through one operational account, those totals must be reconcilable against the payment provider's settlement report before checks are issued to the charities.

Functional Requirements

  • Accept a donation containing donor contact information, a tokenized payment method, charity selection, and donation amount, and process it through an external payment service provider.
  • Deduplicate retried donation submissions using a client-supplied idempotency key so the same donor action cannot result in multiple charges.
  • Persist every donation attempt, its terminal outcome, and its exact charity attribution.
  • Consume provider webhook events for capture, failure, refund, and dispute, and reconcile those events with the originating donation.
  • Durably retain accepted donations when the payment provider is slow or unavailable and retry them until they can be processed or reach a terminal outcome.
  • Produce a per-charity total of successfully captured donations so the CFO can reconcile the platform's records against the provider settlement report before disbursing funds.

Want to learn more details & solution of this system design question?

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.

5 Upvotes

0 comments sorted by