Stripe interview question

How would you solve this differently.