KatInterview

Design a Portfolio Aggregation Service

System DesignModel answer
MediumModel answerSystem Designdata-ingestioneventual-consistencyfinancial-systems

Last updated

Build a system that combines investment data from multiple third-party sources into a unified view with clear freshness indicators and consistent calculations.

You need to architect a service that aggregates investment portfolio information from various third-party data providers. The system should display cash balances, equity positions, digital asset holdings, and calculated summary metrics to end users.

Each connected provider exposes data through its own API with distinct data structures, refresh intervals, and rate-limiting policies. Provider APIs may experience downtime, return stale information, send duplicate records, or issue retroactive corrections. Your users should clearly understand when their displayed information was last updated and should never see silently misleading aggregate numbers.

What You Should Consider

  • Users typically link multiple provider accounts to get a complete financial picture
  • External APIs exhibit varied reliability: some lag by minutes, others may be hours behind, and outages occur unpredictably
  • Calculated metrics like total portfolio value depend on current market prices and currency conversions, which themselves change continuously
  • Most traffic will be users viewing their dashboard; account connections and data syncs happen far less frequently
  • You must be able to explain how any displayed number was calculated, including reproducing historical views

Questions You Should Explore

  • Which displayed values need second-by-second accuracy versus eventual consistency?
  • Does the system ingest individual transactions or only periodic snapshots of balances and holdings?
  • What staleness threshold is acceptable for pricing data before the UI should warn users?
  • What compliance requirements govern data retention, user privacy, and geographic storage?

Hints

Hint 1

Think about how to make repeated API fetches from the same provider safe even if the network duplicates requests or the provider sends the same event twice

Hint 2

Consider how you'll compute a portfolio total when some provider data is fresh but other pieces are hours old—what should the user see?

Hint 3

Design your data model to capture not just what the values are, but when they were observed and from which source