← Stripe Interview Insights

Stripe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Stripe coding screen, one question about matching payments to invoices. Pretty algorithmic for a payments company but made sense once I thought about it.

Questions Asked (1)

Q1

Given a list of payments and a list of invoices, match each payment to its corresponding invoice using the invoiceId field. What do you do with payments that have a null invoiceId or reference an invoice that doesn't exist?

Algorithms & Data StructuresAPI & IntegrationsTechnical Trade-offs
Author's notes

The clarification question about unmatched payments was where I fumbled a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data model and requirements: what fields are available, whether invoiceId is the only matching key, and what the expected behavior is for unmatched payments. Then propose a hash map-based solution for O(n) matching, and discuss strategies for handling null or invalid invoiceId, such as logging, quarantining, or manual review, emphasizing data integrity and idempotency.

Pro tip: Show awareness of real-world payment systems by mentioning idempotency keys and the importance of not silently dropping unmatched payments—they often indicate bugs or fraud. Also, consider suggesting a reconciliation report for unmatched items to aid debugging and auditing.

1. Clarify requirements and data model

Ask about the structure of payments and invoices, whether invoiceId is unique, and what the business rules are for unmatched payments. Confirm if null invoiceId is valid or an error.

2. Design the matching algorithm

Propose using a hash map (dictionary) keyed by invoiceId to achieve O(n) time complexity. Iterate through invoices to build the map, then iterate through payments to find matches.

3. Handle null or invalid invoiceId

For payments with null invoiceId, decide whether to skip, log, or route to a separate queue. For non-existent invoice references, treat as unmatched and handle similarly.

4. Define error handling and logging

Specify that unmatched payments should be logged with details (payment ID, invoiceId, timestamp) and possibly stored for manual review. Avoid silent failures.

5. Discuss trade-offs and scalability

Mention memory usage of the hash map, potential for streaming if data is large, and idempotency to handle retries. Consider batch processing vs. real-time.

Key Points to Mention

  • Hash map for O(n) matching efficiency
  • Null invoiceId handling: log, quarantine, or manual review
  • Non-existent invoice references: treat as unmatched, log for investigation
  • Idempotency and retry safety in payment systems
  • Data integrity: avoid silent drops, maintain audit trail
  • Scalability: memory considerations, streaming, or batch processing

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.