PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/ML System Design/TikTok

Design query generation system

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of ML system design for real-time query suggestion and ranking, encompassing competencies in candidate generation and ranking models, data ingestion and labeling pipelines, online/nearline feature engineering, feedback and retraining loops, latency and scalability constraints, multilingual handling, and safety/policy compliance. It is commonly asked to assess the ability to balance trade-offs between model quality, latency, throughput, and guardrails in operational systems; the domain is ML System Design and the level of abstraction combines practical application with systems-level conceptual reasoning.

  • medium
  • TikTok
  • ML System Design
  • Machine Learning Engineer

Design query generation system

Company: TikTok

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Technical Screen

##### Question Design a query-generation system that maximizes click-through rate (CTR). Discuss architecture, data ingestion, feature engineering, model training/serving, feedback loop, and online/offline evaluation metrics.

Quick Answer: This question evaluates understanding of ML system design for real-time query suggestion and ranking, encompassing competencies in candidate generation and ranking models, data ingestion and labeling pipelines, online/nearline feature engineering, feedback and retraining loops, latency and scalability constraints, multilingual handling, and safety/policy compliance. It is commonly asked to assess the ability to balance trade-offs between model quality, latency, throughput, and guardrails in operational systems; the domain is ML System Design and the level of abstraction combines practical application with systems-level conceptual reasoning.

Related Interview Questions

  • Design video captioning under compute limits - TikTok (medium)
  • Design a model to choose dynamic K - TikTok (medium)
  • Design training for multimodal embedding model - TikTok (medium)
  • What skills are needed for AI infra roles? - TikTok (hard)
  • Design system to detect privacy-leak records - TikTok (medium)
TikTok logo
TikTok
Aug 4, 2025, 10:55 AM
Machine Learning Engineer
Technical Screen
ML System Design
8
0

System Design: Query-Generation to Maximize CTR

Context

You are designing a real-time system that generates and ranks search query suggestions shown to users (e.g., in a mobile app search box or entry points). The objective is to maximize click-through rate (CTR) on these suggested queries while meeting low-latency and high-scale requirements.

Assume:

  • Real-time suggestions under 100 ms p95 latency.
  • Tens to hundreds of millions of daily users, multilingual content.
  • Safety and policy compliance are required.

Task

Describe an end-to-end design covering:

  1. High-level architecture (online and offline paths).
  2. Data ingestion and labeling pipeline.
  3. Feature engineering (online/nearline readiness).
  4. Models for candidate generation and ranking (training and serving).
  5. Feedback/learning loop (exploration, debiasing, retraining).
  6. Evaluation: key offline and online metrics (with definitions).

Discuss key trade-offs, cold-start handling, safety/guardrails, and latency budgets.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More TikTok•More Machine Learning Engineer•TikTok Machine Learning Engineer•TikTok ML System Design•Machine Learning Engineer ML System Design
PracHub

Master your tech interviews with 7,500+ 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.