KatInterview

Build a Global Marketplace Pricing System for Multiple Currencies

System DesignModel answer
HardModel answerSystem Designcurrencypaymentsdistributed-systems

Last updated

Design the full stack — data model, APIs, exchange-rate pipeline, rounding, and UX — for a travel marketplace that lets guests browse and pay in any of ~50 currencies.

Scenario

You are a senior engineer at a global travel marketplace. Hosts list properties and set prices in their local currency. Guests come from all over the world and expect to browse, get a binding price quote, and complete payment in their own currency. The platform processes over 100 000 bookings per day and renders hundreds of millions of prices on search pages.

Your Task

Walk through how you would design the end-to-end multi-currency pricing system for this platform. Your answer should address each of the following areas:

Currency selection and defaulting How does the platform decide which currency to show a new visitor? How does a logged-in user save a preference, and what takes priority?

Storage currency vs. presentation currency Where are canonical prices stored, and how does that differ from what a guest actually sees? What does that mean for the data model?

Conversion timing When is a floating (approximate) conversion acceptable, and when must a rate be locked? What should happen if rates shift between the moment a guest sees a price and the moment they pay?

Exchange-rate sourcing and lifecycle Where do rates come from, how often are they refreshed, and how do you protect the system against a bad rate update or a vendor outage?

Rounding and localization How do you convert line items without accumulating errors? How do you format amounts correctly across different locales and currency conventions?

Taxes and fees Many taxes are defined in the local jurisdiction's currency (for example, a flat €3 city fee per night). How does that interact with the conversion pipeline?

Caching strategy Search pages are latency-sensitive. How do you serve fast price estimates without hitting a live FX service on every request?

Consistency across the booking lifecycle How do you ensure that confirmation emails, PDF invoices, alterations, and refunds all show the same amounts the guest agreed to at checkout?

API and data model Sketch the key endpoints and the most important tables or records. What fields are essential for auditability?

What is Expected

This is a system design question, so a strong answer reasons through trade-offs rather than jumping straight to a schema. Cover the full lifecycle from a guest's first search to a host payout and a potential refund. Call out failure modes, edge cases, and the decisions that are hard to change later.

Hints

Hint 1

There are four distinct currency roles in this system — listing, presentation, charge, and payout — and they are often all different. Naming them explicitly before drawing any data model prevents a lot of confusion downstream.

Hint 2

The most important architectural decision is when a rate gets locked. Browse-time prices can be approximate and ephemeral, but a price the guest has agreed to pay must be frozen in an immutable snapshot that every future artifact (invoice, refund, ledger entry) can reference.

Hint 3

Never store or compute money as a float. Use integer minor units paired with an ISO-4217 currency code, and keep a single shared table of currency exponents (JPY=0, USD=2, KWD=3). Rounding mode and cash-rounding rules also belong in that config, not scattered across services.