Build a Dual Fixed-Window Rate-Limiting Middleware
Company: Headway
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
Quick Answer: Design FastAPI middleware that enforces both a global limit of 100 requests per minute and a per-domain limit of 3 requests per second. Make the API or object boundaries explicit, then cover invariants, edge cases, testing strategy, and operational trade-offs.