PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/ML System Design/Perplexity

Design trending queries ranking system

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to design scalable, low-latency ML-driven systems for detecting and ranking trending queries, covering competencies in real-time event ingestion, streaming aggregation, ranking and scoring methods, personalization, and abuse mitigation.

  • medium
  • Perplexity
  • ML System Design
  • Software Engineer

Design trending queries ranking system

Company: Perplexity

Role: Software Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Onsite

You are designing a system to power the **Top Trending Queries** section on the home page of an AI search/Q&A platform (similar to Perplexity). The product shows a list of trending user queries (search prompts) to visitors. Initially this list can be global, but over time you may want to **personalize** it (e.g., by country, language, or user interests). **Requirements and goals**: - Continuously identify queries that are "trending" (rising in popularity) in near real time. - Rank top K trending queries for the **home page**. - Support: - Global trending queries. - Trending queries per region or segment (e.g., country, language, topic). - Eventually allow **personalization**: show trending queries that are more relevant to a specific user or user segment. - Handle very high query volume (e.g., tens of thousands of QPS). - Keep results fresh (updated within a few seconds to a few minutes). **Design task**: Describe how you would design this trending queries system, including: 1. How you collect and process raw query events. 2. How you define and compute "trending" (not just absolute popularity but spikes/velocity). 3. The data architecture for real-time or near-real-time aggregation (streaming vs batch). 4. How you store and serve the top K trending queries globally and by segment. 5. How you might add personalization over time (per user or per user group). 6. Key metrics, scaling considerations, and how to handle spam/abuse. You do not need to provide code, but you should describe main components, data flows, and algorithms or approximations (e.g., for top-K) that you would use.

Quick Answer: This question evaluates the ability to design scalable, low-latency ML-driven systems for detecting and ranking trending queries, covering competencies in real-time event ingestion, streaming aggregation, ranking and scoring methods, personalization, and abuse mitigation.

Related Interview Questions

  • Design personalized discovery recommendations - Perplexity (medium)
Perplexity logo
Perplexity
Sep 4, 2025, 12:00 AM
Software Engineer
Onsite
ML System Design
7
0
Loading...

You are designing a system to power the Top Trending Queries section on the home page of an AI search/Q&A platform (similar to Perplexity).

The product shows a list of trending user queries (search prompts) to visitors. Initially this list can be global, but over time you may want to personalize it (e.g., by country, language, or user interests).

Requirements and goals:

  • Continuously identify queries that are "trending" (rising in popularity) in near real time.
  • Rank top K trending queries for the home page .
  • Support:
    • Global trending queries.
    • Trending queries per region or segment (e.g., country, language, topic).
  • Eventually allow personalization : show trending queries that are more relevant to a specific user or user segment.
  • Handle very high query volume (e.g., tens of thousands of QPS).
  • Keep results fresh (updated within a few seconds to a few minutes).

Design task:

Describe how you would design this trending queries system, including:

  1. How you collect and process raw query events.
  2. How you define and compute "trending" (not just absolute popularity but spikes/velocity).
  3. The data architecture for real-time or near-real-time aggregation (streaming vs batch).
  4. How you store and serve the top K trending queries globally and by segment.
  5. How you might add personalization over time (per user or per user group).
  6. Key metrics, scaling considerations, and how to handle spam/abuse.

You do not need to provide code, but you should describe main components, data flows, and algorithms or approximations (e.g., for top-K) that you would use.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Perplexity•More Software Engineer•Perplexity Software Engineer•Perplexity ML System Design•Software Engineer ML System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.