For All Intents And Purposes Part 3 - Accepting Failure π
See Stripe hiring insights
π Hi there! The description you are currently reading is just 3rd part of the problem set. It is highly recommended to read ALL THE PARTS before coding as parts may build on top of each other π³
The rest of the team is thrilled with our progress building Stripe's new Payment Intent processor, but they pointed out a few cases we should handle before releasing the system to the public π₯
First, payments don't alway succeed and can fail for a variety of reasons like a card network declining a transaction or a bank account not having sufficient funds to be debited. Second, even after payments have succeeded, customers need to be able to request refunds from merchant.
Let's update our implementation to handle two new commands: FAIL and REFUND π₯Ή.
Commands
FAIL <payment_intent_id>
REFUND <payment_intent_id>
βΉ ΰ£ͺ οΉποΉποΉCredit to Rachel π³
commands = ["INIT m1 0", "CREATE p1 m1 50", "ATTEMPT p1", "FAIL p1", "ATTEMPT p1", "SUCCEED p1", "CREATE p2 m1 100", "ATTEMPT p2", "SUCCEED p2", "REFUND p2"] return = ["m1 50"]
π«Ά
- Account Balance Manager Part 3 - Platform CoverageONSITE INTERVIEW Β· Seen Jun 2026
- BitFont Part 3 - Decode Run-Length-Encoded RowsONSITE INTERVIEW Β· Seen Jun 2026
- Record Linkage Part 3 - Full Connected ComponentPHONE SCREEN Β· Seen Jun 2026
- Shipping Cost Calculator Part 3 - Mixed Fixed/Incremental TiersONSITE INTERVIEW Β· Seen Jun 2026
- Transaction Fee Calculator - Per-Merchant Volume DiscountPHONE SCREEN Β· Seen Jun 2026
- Account Balance Manager Part 2 - Reject OverdraftsONSITE INTERVIEW Β· Seen Jun 2026
- BitFont Part 2 - Render a WordONSITE INTERVIEW Β· Seen Jun 2026
- Factory Cost - Min-Cost Path Skipping One StagePHONE SCREEN Β· Seen Jun 2026
public String[] forAllIntentsAndPurposes3(String[] commands) {
// write your code here
}