Start by clarifying the requirements: historical rates imply read-heavy, immutable data, so focus on caching and read scalability. Then walk through each component (API, data model, storage, caching, consistency, scalability, monitoring) with a bias toward simplicity and cost-efficiency, justifying choices based on the 10K RPS target.
Pro tip: Emphasize that historical exchange rates are immutable, so you can aggressively cache and use eventual consistency, which simplifies scaling. Also, mention that you'd start with a simple solution and iterate based on monitoring data, rather than over-engineering from day one.
Ask questions to understand the scope: which currencies, date range, update frequency, latency SLA, and consistency needs. State assumptions like rates are updated daily and historical data is immutable.
Define RESTful endpoints (e.g., GET /rates?from=USD&to=EUR&date=2023-01-01) and a simple data model with fields like base currency, target currency, date, and rate. Consider bulk endpoints for multiple dates/currencies.
Select a storage solution optimized for read-heavy, immutable data (e.g., a key-value store or a relational database with read replicas). Implement multi-layer caching (CDN, in-memory cache like Redis) with long TTLs since data doesn't change.
Since historical data is immutable, eventual consistency is acceptable. Scale horizontally with stateless services, load balancers, and auto-scaling. Monitor key metrics: request rate, latency, cache hit ratio, error rates, and set up alerts.
Recap the design, highlighting trade-offs (e.g., cost vs. performance). Suggest starting with a simple architecture and iterating based on monitoring data and user feedback.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.