KatInterview

Building a Resilient Payment Processing Service

System DesignModel answer
MediumModel answerSystem Designreliabilitystorage-architecturepayments

Last updated

Design a payment calculation service that maintains SLAs during dependency failures and choose appropriate storage for financial data correctness.

You're designing a service that computes payment amounts for delivery orders based on lifecycle events (order created, picked up, delivered, cancelled, tip modified, etc.).

Address these two architectural challenges:

Part 1: Maintaining Service Reliability Your service depends on several external systems (pricing engines, distance calculators, configuration services, incentive platforms). If one of these dependencies experiences severe latency degradation, what strategies would you employ to ensure your service continues meeting its latency and availability commitments?

Part 2: Storage Architecture Decision You need to persist order state and payment calculations. Evaluate the trade-offs between using an in-memory data store like Redis, a traditional relational database, or alternative storage technologies. What would you recommend and why?

Your answer should demonstrate understanding of distributed systems resilience patterns and storage choices driven by correctness requirements rather than performance alone.

Hints

Hint 1

Consider separating synchronous user-facing APIs from asynchronous event processing—they have different SLA requirements and failure modes

Hint 2

For payments specifically, think about what happens if you acknowledge a write but then lose it during failover—can you afford that risk?

Hint 3

Circuit breakers and timeouts are table stakes; what about fallback strategies when dependencies are degraded but not completely down?