The question was to design a payment processor.
The basic flow was that a merchant first sends a hold request, which we forward to the upstream payment network, then receive an approval or rejection. After a successful hold, there is a separate charge request later. Charges are then grouped by payment network into batch files and sent on a schedule.
I'd prepared for payment-system questions before, but during the interview I realized that having prepared a similar question can make it easy to jump to assumptions. In particular, I needed to first clarify the triggers and returned results for the hold, the charge, and the final batch processing.
What result has the user actually received?
If we return as soon as the request is written to Kafka, the merchant doesn't yet know whether the hold succeeded or failed.
Where does deduplication happen?
How do we scale, and how do we handle large amounts of batch data?
For the batch part, we discussed generating batches in parallel by payment network and spreading the work throughout the day, preparing the data incrementally.
Another very practical pitfall was drawing the diagram. I wasn't familiar enough with Excalidraw, and drawing boxes and connections took some time. I'd suggest practicing with the tool beforehand. During the interview, the diagram only needs to support the discussion.
OpenAI Software Engineer Interview Experience — Payment Holds, Charges, and Batch Processing
Technical Screenmedium
Published
Curated and edited by PracHub
Discussion
Loading comments…