Had my phonescreen for Stripe L2 position (Bangalore, India).
This was the problem:
Stripe’s Invoicing product allows businesses to create and send invoices to their customers. While many invoices can be paid directly, there are cases where standalone payments need to be reconciled with open invoices for a customer.
Your task is to write a program that matches incoming payments to their corresponding invoices based on the payment’s memo line.
You are given:
• A payment string
• A list of invoice strings
The payment string is a comma-separated string containing:
Each invoice string is also comma-separated and contains:
You need to:
• Parse the payment and invoices.
• Find the invoice mentioned in the memo line.
• Output a formatted string describing the reconciliation.
Input Example:
payment = "payment5,1000,Paying off: invoiceC"
invoices = [
"invoiceA,2024-01-01,100",
"invoiceB,2024-02-01,200",
"invoiceC,2023-01-30,1000"
]
Expected Output:
payment5 pays off 1000 for invoiceC due on 2023-01-30
Be ready to generate the input on your own and write your own test cases to test the solution(more than 2). I was aware that string parsing is popular in stripe interviews, but wasnt expecting the above two. I was thinking that i will be asked to write the solution function and then there will be test cases against which the code will be run. So a lot of time got wasted there. Not expecting much.