Databricks System Design Interview: Game Payment System

Based on a candidate's reported Databricks interview

The interviewer opens

Hi, and thanks for joining. Welcome to your interview for the Senior Engineer role at Databricks. We'll design a system together, and you can sketch on the whiteboard on the right of your screen as you talk. If you need to step out or take a break, the Pause button at the top right will pause the interview.

The problem is a payment system for an online game, and it's already in your Problem tab. Please read it through and ask me anything you'd like clarified before you start designing.

The problem

Design the payment system for an online game platform. Players buy in-game credits with a credit card, spend credits on in-game items, and can get refunds. Charges, credits and items must stay correct under heavy concurrency and partial failures.

Must do

  • Players buy credit packs with a saved or new credit card
  • Players spend credits to buy in-game items
  • Players see their credit balance and owned items
  • Card purchases and credit-for-item purchases can be refunded
  • Finance can reconcile money charged against credits granted

Must hold

  • No player is charged twice or charged without receiving credits
  • Balances never go wrong under concurrent spends or partial failures