Design Query Volume Aggregation and Serving for Google Trends
Last updated: November 29, 2026
Quick Overview
Design the backend for Google Trends that aggregates search query volume by topic, region, and time, normalizes it to a 0 to 100 interest scale, and serves interactive charts and real-time trending stories.
0
0
0 solved
Design the backend for Google Trends that aggregates search query volume by topic, region, and time, normalizes it to a 0 to 100 interest scale, and serves interactive charts and real-time trending stories.
A Google onsite question bridging data pipelines and serving. The interviewer looks at entity mapping of raw queries, multi-resolution rollups, privacy thresholds, normalization, and how real-time data differs from historical data.
What the Interviewer Expects
- Map raw queries to topics or entities before aggregating
- Precompute rollups at several time and geo granularities
- Apply sampling and minimum thresholds for privacy
- Explain the 0 to 100 normalization relative to peak in the selected range
- Separate a streaming path for the last 7 days from batch history
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
- Why does Trends show relative interest rather than absolute counts?
- How do you compare five terms on one chart consistently?
- How would you detect a 'breakout' query?
- How do you serve a chart for a tiny region with few searches?
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
- Inputs: anonymized search logs, billions of queries per day.
- Outputs: interest over time (hourly for recent, daily or weekly for years back to 2004), interest by region down to city, related queri...
High-Level Design
- Batch pipeline (daily): sample queries, map each to entities via the Knowledge Graph entity linker and to normalized search terms, then aggregate counts by
(term_or_topic, geo, day)along wit...