Design Result Caching and Invalidation for Bing Search Pages
Last updated: November 29, 2026
Quick Overview
Design a cache for Bing search result pages that serves repeated queries quickly, keeps results fresh when the index updates or news breaks, and stays correct across markets and safe search settings.
Microsoft
November 29, 20260
0
0 solved
Design a cache for Bing search result pages that serves repeated queries quickly, keeps results fresh when the index updates or news breaks, and stays correct across markets and safe search settings.
Search engines serve a large fraction of traffic from caches, and Bing interviewers use this to probe cache key design, TTL versus event-driven invalidation, and staleness trade-offs. The interviewer checks you do not cache personalized parts and that a breaking news query does not stay stale.
What the Interviewer Expects
- Builds a cache key from normalized query plus every parameter that changes results
- Caches the core result set separately from personalized and dynamic modules
- Uses adaptive TTLs based on query freshness needs
- Invalidates or refreshes on index updates for affected queries
- Prevents stampedes with stale-while-revalidate and single flight
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 decide that 'election results' needs a 30 second TTL but 'pythagorean theorem' can be cached for a day?
- How would you avoid serving an empty page cached during a backend outage?
- What hit rate do you expect, and what drives it?
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
Cache the top results for queries. Results must differ by market, language, safe search level, device type, and page offset. Hit latency under 10 ms. Fresh queries (news, sports, stocks) should not la...
High-Level Design
Front door -> query service. The query service normalizes the query (case folding, whitespace, spelling-variant canonicalization) and builds key = `hash(normQuery, market, safeSearch, offset, vert...