Rate Limit the Public Yahoo Finance Quote API per Key and IP
Last updated: November 29, 2026
Quick Overview
Design rate limiting for a public quote and chart data API that is called by apps, partners, and scrapers. Limits differ per plan, must apply across many API servers in multiple regions, and must not add noticeable latency.
Yahoo
November 29, 20260
0
0 solved
Design rate limiting for a public quote and chart data API that is called by apps, partners, and scrapers. Limits differ per plan, must apply across many API servers in multiple regions, and must not add noticeable latency.
Yahoo Finance data is heavily scraped, so quota enforcement protects both cost and partner contracts. The interviewer checks algorithm choice, distributed counter design, and how you behave when the limiter itself is unhealthy.
What the Interviewer Expects
- Choose a token bucket or sliding window counter and justify it
- Key limits by API key, by IP for anonymous traffic, and by endpoint cost
- Store counters in a low-latency shared store with atomic operations
- Return 429 with Retry-After and rate limit headers
- Discuss local pre-limiting to cut round trips
- Define fail-open versus fail-closed behavior
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you enforce a global daily quota across three regions?
- How do you weight an expensive 10-year chart request versus a single quote?
- How would you detect scrapers rotating through thousands of IPs?
- How would you let a partner burst during earnings season without raising their steady limit?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: per-key limits like 100 requests per second and 1M per day by plan; per-IP limits for anonymous calls; cost weights per endpoint. Non-functional: under 2 ms added latency, accurate within ...
High-Level Design
- API gateway in each region runs the limiter as middleware before routing to quote services.
- Limit config service maps keys to plans and endpoint weights, cached in gateways.
- **Counter st...