Build a Multi-Institution Personal Finance Dashboard
System DesignModel answerLast updated
Design a system that ingests transactions and balances from banks and credit cards, normalizes and deduplicates them, and powers budgeting and alerting features.
Build a Multi-Institution Personal Finance Dashboard
You are designing a consumer-facing platform that lets users connect their bank accounts, credit cards, and loans in one place. Once connected, the platform continuously pulls in balances and transactions, organizes them, and helps users understand their spending.
Core capabilities to cover
- Account linking: users can connect accounts from hundreds of different financial institutions
- Data ingestion: balances and up to two years of transaction history are fetched and kept current
- Normalization: raw data from different providers is mapped into a consistent internal format
- Categorization: transactions are automatically labeled (e.g., Groceries, Rent, Subscriptions) and users can override labels
- Budgets: users set monthly spending limits per category; the system tracks progress
- Recurring bill detection: the system identifies regular charges such as Netflix or rent
- Alerts: users receive notifications for low balances, unusually large charges, upcoming bills, and budget overruns
The platform is read-only — it never initiates transfers or payments.
What to address in your answer
- Ingestion strategy: how you connect to institutions (third-party aggregators vs. direct integrations), what protocols are involved, and how syncs are triggered
- API surface: the key endpoints your backend exposes to the client
- Data model: schema design for accounts, transactions, balances, and budgets — including multi-currency support and money-safe numeric representation
- Deduplication and reconciliation: handling pending-to-posted transitions, provider retries, and balance drift
- Security and privacy: where credentials live, encryption boundaries, and how you minimize PCI scope
- Scalability and storage: throughput estimates, sharding strategy, and how downstream features (budgets, alerts) consume transaction data
- Failure handling: what happens when a provider is slow, returns stale data, or goes down
Scale assumptions to work from
- 20 million registered users, around 4 million active daily
- Average of four linked accounts per user across roughly 15,000 institutions
- Approximately 160 million transactions ingested per day at steady state, with sharp morning peaks when banks post overnight batches
Address trade-offs as you go. There is no single correct architecture, but your choices should be justified.
Hints
Hint 1
Start by separating the ingestion path from the read path. The system is write-heavy during batch windows but read-mostly for individual users — that asymmetry should drive your storage and sharding choices.
Hint 2
Pending-to-posted reconciliation is one of the trickiest parts. A provider often assigns a brand-new transaction ID when a pending charge settles, so you cannot rely on ID matching alone. Think about what signals you can combine to fuzzy-match the two records.
Hint 3
Never store raw amounts as floats. Use integer minor units (cents, pence, etc.) with an explicit ISO 4217 currency code, and keep each transaction in its original currency. Convert to a home currency only at display or aggregation time, recording which exchange rate was used.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing the problem
The challenge here is not web scale in the abstract — it is fintech-specific correctness: unreliable third-party data, money arithmetic, deduplication across providers, and tight security requirements. A strong answer gets an end-to-end pipeline on the board quickly, then goes deep on those hard parts. Spending the first half of the interview on generic load balancers is a common mistake.
1. Clarify and size the system
Functional scope (confirm read-only): link accounts, ingest history, normalize, categorize, budget, detect recurring charges, alert.
Non-functional targets: transactions are fresh within ~24 hours on a schedule and within minutes on a webhook or manual refresh. No double-counted transactions. Strong security. Graceful degradation when providers are slow or down.
Back-of-envelope
| Signal | Estimate |
|---|---|
| Accounts | 20M users × 4 = 80M accounts |
| Ingest rate | ~2 txns/account/day = 160M/day, ~1,900/s average, ~10,000/s morning peak |
| Storage | ~1 KB/txn normalized = ~160 GB/day, ~60 TB/year hot; raw payloads in object storage separately |
| Read QPS | 4M DAU × ~10 requests = ~1,800 QPS average, highly per-user |
Write-heavy ingestion with per-user, read-mostly access — this points strongly to sharding by user_id.
2. Ingestion strategy
Aggregator vs. direct
Use a third-party aggregator (Plaid, MX, Finicity) for the long tail of institutions. They give fast coverage and handle credential management, at the cost of per-call fees and inherited outages. Build direct connections for the top 20–30 institutions, which cover the majority of users. Use OAuth-based bank APIs (the FDX standard, or OFX Direct Connect for legacy institutions).
Never store user banking credentials. Screen-scraping is a liability and is being phased out under CFPB open-banking rules.
Wrap both paths behind a ProviderAdapter interface: link(), fetchAccounts(), fetchTransactions(cursor), handleWebhook(). A routing table maps each institution to a primary provider with a fallback.
Sync triggers
- Provider webhooks (e.g.,
TRANSACTIONS_AVAILABLE) for near-real-time freshness - Scheduled daily refresh, jittered across users to flatten the load curve
- User-initiated pull-to-refresh, rate-limited per user
Always sync incrementally using a cursor or since timestamp, and re-pull a 7–14 day overlap window to catch late postings and corrections.
3. API surface
POST /link/token # short-lived token for the client linking widget
POST /connections {public_token} # exchange token; returns connection_id
GET /connections/{id} # status: HEALTHY | SYNCING | REAUTH_REQUIRED | ERROR
POST /connections/{id}/refresh # 202 Accepted, async
GET /accounts # balances, currency, as_of timestamp
GET /transactions?account=&from=&to=&cursor=
PATCH /transactions/{id} {category_id, note}
GET|PUT /budgets
GET /recurring
GET|PUT /alert-rules
POST /webhooks/{provider} # signature-verified, enqueued immediately, returns 200
Webhook endpoints must return 200 fast. Do all processing asynchronously to avoid timeouts that cause provider retries.
4. Data model
connections(connection_id, user_id, institution_id, provider,
token_ref, -- points into Token Vault, not stored here
status, cursor, last_synced_at)
accounts(account_id, user_id, connection_id, provider_account_id,
type, subtype, currency CHAR(3), mask_last4, name)
balance_snapshots(account_id, as_of, current_minor BIGINT,
available_minor BIGINT, currency CHAR(3)) -- append-only
transactions(txn_id, user_id, account_id, provider, provider_txn_id,
pending_of_txn_id, -- links pending row to its settled version
status PENDING|POSTED|REMOVED,
amount_minor BIGINT, currency CHAR(3),
txn_date, posted_date,
raw_merchant, merchant_id, category_id,
category_source RULE|ML|USER,
fingerprint, version,
UNIQUE(account_id, provider, provider_txn_id))
fx_rates(base CHAR(3), quote CHAR(3), date, rate NUMERIC(20,10))
budgets(budget_id, user_id, category_id, period, limit_minor BIGINT, currency CHAR(3))
recurring_series(series_id, user_id, merchant_id, cadence,
expected_amount_minor, amount_tolerance,
next_expected_date, status)
Money rules: always store integer minor units (cents, pence) with an explicit ISO 4217 code. Never floats. Keep each transaction in its original currency; convert to home_currency only at display or aggregation time, recording the exchange rate used. Outflows are negative; credit card and loan accounts are liabilities.
5. Architecture overview
Client → API Gateway → {Link, Read, Budget, Alert} services
↑
Webhooks / Scheduler → Sync Orchestrator → per-provider queues → Ingestion Workers
→ raw payloads → S3 (encrypted, replayable)
→ Kafka "raw-txns"
→ Normalizer → Dedup/Reconciler → Postgres (sharded by user_id)
→ Kafka "txn-events"
→ Categorizer, Recurring Detector, Budget Aggregator, Alert Engine
→ Notification Service (push/email, respects quiet hours)
Token Vault (isolated service + KMS) → holds provider OAuth tokens
CDC from Postgres → data warehouse (de-identified) for ML training and analytics
Keeping the Token Vault as a separate service with its own KMS key is the primary way to minimize PCI scope. The main application never touches raw credentials.
6. Deduplication and reconciliation
Idempotent upsert: the unique key (account_id, provider, provider_txn_id) makes retries and overlapping sync windows safe. A version column handles optimistic concurrency.
Pending → posted: this is the hardest dedup case. When a charge settles, providers often assign a new transaction ID. If the provider returns a pending_transaction_id on the posted record, link directly. Otherwise, fuzzy-match on: same account, same currency, amount within a tolerance (tips and gas holds shift the amount), merchant similarity, and date within ±5 days. Mark the pending row REMOVED, set pending_of_txn_id, and carry over any user-set category or note.
Cross-provider duplicates: happen when the same account is linked via two providers (e.g., after a failover). Detect by an account fingerprint (institution, masked account number, type). Merge at the account level and hide the duplicate.
Balance reconciliation: periodically check prev_balance + Σ posted_deltas ≈ current_reported_balance. On drift, re-pull a wider window from the provider or replay from the S3 raw archive. Every aggregate is derived from txn-events, so it is fully rebuildable by replay — aggregates must never be the source of truth.
7. Failure handling
- Per-provider circuit breakers with exponential backoff. Surface
DEGRADEDstatus to users rather than silently serving stale data. - SLA tiers by institution importance: direct connections get retries within minutes; aggregator-backed institutions may wait for the next scheduled window.
- Dead-letter queues for failed ingestion jobs, with alerting to on-call.
- Separate read availability from sync freshness: users can always see their last-known data even if a sync is failing.
Common mistakes to avoid
- Using floats for money amounts (rounding errors compound across millions of transactions)
- Storing provider OAuth tokens in the main application database instead of an isolated vault
- Treating aggregator uptime as your uptime — model provider failures explicitly
- Building budget and alert logic on top of mutable aggregates instead of an immutable event log
- Ignoring sign convention differences across providers (some report debits as positive, some as negative)