PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/ML System Design/TikTok

Design query generation to maximize CTR

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in end-to-end ML system design for query generation and CTR optimization, covering candidate generation and ranking, exploration–exploitation, real-time inference, personalization, safety/privacy, evaluation, and scalability.

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

Design query generation to maximize CTR

Company: TikTok

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: hard

Interview Round: Technical Screen

Design an end-to-end query generation system that maximizes click-through rate (CTR) for a search/recommendation product. Specify goals, constraints, and metrics; data sources and feature engineering; candidate generation and ranking models; exploration–exploitation strategy (e.g., bandits), feedback loops, and debiasing; offline evaluation (training/validation splits, counterfactual evaluation) and online A/B testing; real-time inference architecture, latency/throughput/SLA considerations, and scalability; personalization, cold start, and diversity controls; safety/abuse and privacy compliance. Provide diagrams or pseudocode for critical components and outline how you would iterate after launch.

Quick Answer: This question evaluates a candidate's competency in end-to-end ML system design for query generation and CTR optimization, covering candidate generation and ranking, exploration–exploitation, real-time inference, personalization, safety/privacy, evaluation, and scalability.

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
Jul 31, 2025, 12:00 AM
Machine Learning Engineer
Technical Screen
ML System Design
2
0

System Design: End-to-End Query Generation to Maximize CTR

Context

You are designing the query-generation layer for a consumer search/recommendation product with a search box and a highly dynamic content feed. The system should:

  • Generate user-facing query suggestions (e.g., autocomplete, related queries) that users can click.
  • Optionally rewrite/expand the user’s typed query into internal retrieval queries to fetch better candidates.

Assume scale is very large, traffic is global and mobile-first, and content is short-form, fast-evolving, and safety-sensitive.

Task

Design an end-to-end system that maximizes click-through rate (CTR) for query suggestions while protecting user experience and safety. Address:

  1. Goals, constraints, and metrics
  2. Data sources and feature engineering
  3. Candidate generation and ranking models
  4. Exploration–exploitation (e.g., bandits), feedback loops, and debiasing
  5. Offline evaluation (splits, counterfactual evaluation) and online A/B testing
  6. Real-time inference architecture, latency/throughput/SLA, and scalability
  7. Personalization, cold start, and diversity controls
  8. Safety/abuse and privacy compliance
  9. Diagrams or pseudocode for critical components
  10. How you would iterate after launch

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.