Back to problems

Design a Top-K search words service

System Design · LinkedIn · Medium

You are asked to architect a backend service that ingests user search events and can answer queries for the most frequent search terms. Functional requirements: Provide an endpoint to log a search event, such as a user submitting the phrase "wireless earbuds". Provide an endpoint to retrieve the top K most frequent queries. Support two time scopes: all-time ranking trending ranking over a configurable recent window (e.g., last M minutes or hours) Non-functional requirements:…

Checking your access…