注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
对于机器学习系统设计面试,市面上除了Alex Xu的ML System Design书上面有限的数道题目,一直没有很好的题库总结和参考答案来辅助高效准备面试。我总结了一下一些大厂和独角兽常考的ML System Design题库题,方面大家学习和准备面试。求赞求米!
🎯 Recommendation Systems
- Large-Scale Video Recommendation System Design
Design an end-to-end recommendation system for a global video streaming platform with 500M users and 100M videos. The system must optimize for multiple objectives (CTR and Watch Time) while meeting a 200ms P99 latency SLA. Detail the multi-stage architecture, including candidate retrieval via embedding-based search and high-precision ranking. Address specific challenges like position bias, delayed feedback in watch-time labels, and the infrastructure required for real-time feature freshness and model monitoring in production. - Large-Scale Recommendation Ranking for Long User Sequences
Design the final-stage ranking system for a content discovery platform (like Pinterest) where users have long-term interaction histories (1,000+ events). Your system must efficiently handle these sequences to capture both long-term and short-term interests within a 100ms P99 latency budget. Detail the data and feature pipelines, the specific attention mechanisms used to overcome the computational cost of long sequences, and how the system maintains online/offline consistency for embedding-based features. - Scalable Similar Listings Recommendation System
Design a high-scale 'Similar Listings' recommendation engine for a global vacation rental platform with 10M+ properties. The system must surface relevant, available alternatives in real-time (<150ms P99) while a user browses a Listing Detail Page. Focus on the end-to-end ML lifecycle: from multi-modal feature engineering (text, images, metadata) and handling unique inventory availability constraints, to a two-stage retrieval and ranking architecture. Discuss strategies for addressing listing cold-start, training/serving data consistency, and how to optimize for long-term business metrics like booking conversion rate. - Scalable Short-Video Recommendation System Design
Design the core recommendation engine for a high-growth short-form video platform similar to TikTok. The system must serve personalized content to 100M+ daily active users from a corpus of 100M+ videos. Your design should specifically address the multi-stage funnel (retrieval and ranking), the optimization for multiple competing objectives (e.g., watch time vs. engagement), and the engineering of real-time data pipelines to handle sub-second feedback loops. Focus on how you would minimize serving latency while maximizing content freshness and handling the cold-start problem for new creators. - Scalable Video Recommendation System Design
Design an end-to-end recommendation system for a global video streaming platform with 100M+ DAU. The system must maximize user engagement (watch time) while maintaining low latency (<200ms). Detail the multi-stage architecture (retrieval and ranking), explain how you handle high-cardinality categorical features, and describe the data pipelines required to minimize training-serving skew. Address how the system balances different product objectives (e.g., clicks vs. completion rate) and how you ensure the model remains fresh in the face of rapidly changing trends. - Ad Ranking and Revenue Optimization System
Design a high-scale, low-latency ads ranking system capable of selecting the most relevant ads from a corpus of 100M+ candidates. The design must address the dual goals of maximizing platform revenue (eCPM) and user experience. Specifically, detail the multi-stage retrieval and ranking pipeline, strategies for handling extreme feature sparsity, techniques for model calibration to support fair auctions, and mechanisms to mitigate position bias and handle delayed feedback from conversion events. Discuss the system architecture required to support 50k+ QPS with sub-100ms P99 latency while ensuring offline-online feature consistency. - Large-Scale Discovery and Recommendation System
Design a high-scale content discovery feed for a visual-first social platform (similar to Pinterest) serving billions of items to hundreds of millions of users. The system must optimize for both immediate engagement (clicks) and long-term utility (saves/re-pins). Your design should address the full ML lifecycle: from multi-modal data ingestion (images, text, graphs) and feature engineering for low-latency retrieval, to multi-task model training that balances conflicting objectives. Detail your strategy for handling massive-scale candidate generation, real-time ranking with under 200ms latency, and the mechanisms you would implement for model observability, drift detection, and continuous improvement through feedback loops. - Large-Scale Online Ads Ranking and Auction System
Design a high-throughput ads ranking system for a social media platform with 500M DAU. The system must select the most relevant ads from a corpus of 10M candidates within a 100ms P99 latency budget. Focus on the end-to-end ML lifecycle: from real-time feature engineering (handling user signals) and multi-stage funnel architecture (retrieval and ranking), to specialized ad-tech challenges like position bias, click/conversion calibration for auctions, and handling delayed feedback loops in conversion data. Discuss the trade-offs between model complexity and serving constraints, and how to ensure the system maximizes long-term revenue (eCPM) while maintaining advertiser trust through accurate ROI predictions. - Short-Form Video Recommendation System
Design the end-to-end recommendation engine for a short-form video platform similar to TikTok. The system must scale to 1B+ users and 100M+ videos, delivering personalized content with sub-150ms latency. Your design should specifically address the multi-objective nature of engagement (watch time, likes, shares), the need for ultra-fresh real-time user feedback, and strategies for video cold-start/exploration. Elaborate on the data pipelines for real-time feature engineering, the two-stage retrieval and ranking architecture, and the infrastructure required for continuous model evaluation and deployment. - Music Recommendation System for High-Scale Streaming
Design a personalized music recommendation system for a global streaming platform with 500M+ users and 100M+ tracks. The system must handle high-concurrency requests (50k+ QPS) with sub-200ms latency. Detail the end-to-end architecture including multi-stage retrieval, ranking strategies to balance engagement vs. discovery, real-time feature engineering for session-based personalization, and robust evaluation frameworks to measure long-term user retention. Address specific challenges like audio-based cold start, handling negative signals (skips), and maintaining model freshness at scale. - Large-Scale Personalized Video Recommendation System
Design a recommendation system for a video platform with 1B+ users and 100M+ videos. The system must provide personalized content in real-time with a P99 latency of <200ms. Detail the two-stage pipeline (retrieval and ranking), explain how you handle real-time user feedback, discuss strategies for negative sampling in training, and describe how the system addresses position bias and data freshness. Ensure the design includes a robust infrastructure for model evaluation and monitoring for training-serving skew. - Large-Scale E-commerce Recommendation System
Design an end-to-end recommendation system for a global e-commerce platform with hundreds of millions of users and products. The system must surface personalized product suggestions in real-time on the homepage. Address the full ML lifecycle: building scalable data pipelines for high-throughput clickstream data, a two-stage retrieval and ranking architecture to meet a 150ms P99 latency budget, strategies for handling cold-start items, and techniques for optimizing multiple objectives like CTR and conversion rate. Detail your approach to ensuring offline/online feature consistency and monitoring for model performance degradation in a production environment. - Personalized Restaurant Recommendation and Ranking System
Design a high-scale recommendation and ranking system for a global food delivery platform. The system must handle over 100 million users and a million restaurants, delivering personalized results within a 200ms latency budget. Focus on the end-to-end ML lifecycle, specifically addressing geo-spatial constraints, real-time context (like weather and ETA), multi-stage ranking (retrieval vs. ranking), and the handling of the extreme feedback loop inherent in food ordering behavior. - Scalable Personalized Content Feed Design
Design a large-scale personalized article recommendation system for a platform with 100M+ users. The system must provide real-time updates for news freshness, handle high-throughput candidate retrieval from a corpus of 10M+ items, and optimize for multi-objective engagement (clicks vs. read time). Detail the data lifecycle from ingestion to model serving, and discuss how you mitigate common production issues like position bias, cold-start items, and training-serving skew. - Evaluation System for Large-Scale Recommendation Models
Design a high-scale evaluation and experimentation platform for a recommendation system (e.g., Amazon or YouTube). Your system must handle the end-to-end lifecycle: from offline backtesting using historical logs and counterfactual techniques to online A/B testing and shadow deployment. Address specific challenges such as selection bias in offline data, delayed feedback for conversion labels, and ensuring consistency between training and serving features. Explain how you would measure success using both ML-specific metrics (NDCG, AUC, Calibration) and business KPIs, while maintaining a strict P99 latency SLA for production traffic. ---
💰 Ads & Monetization
- Ad Click-Through Rate (CTR) Prediction System
Design a high-scale Ad Click-Through Rate (CTR) prediction system capable of processing 100k+ QPS with sub-100ms latency. The system must handle a corpus of 10 million ads and 100 million users. Detail the multi-stage ranking funnel (retrieval and ranking), feature engineering for high-cardinality ID features, strategies for addressing training-serving skew, and how to maintain model calibration for downstream bidding. Explicitly discuss data ingestion, distributed training for massive datasets, and real-time monitoring of model performance and data drift. - Real-Time Bidding (RTB) System Design
Design a high-scale Real-Time Bidding (RTB) system for a Demand-Side Platform (DSP). The system must process over 1 million bid requests per second from global ad exchanges with a strict P99 latency of 50ms. Detail the architecture for predicting Click-Through Rate (CTR) and Conversion Rate (CVR), incorporating real-time budget pacing, handling delayed conversion feedback, and ensuring model calibration for accurate financial bidding. Explain your choices for data ingestion, low-latency feature retrieval, and the trade-offs between model complexity and inference speed in a production environment. ---
🛡️ Trust, Safety & Moderation
- Real-time Payment Fraud Detection System
Design a high-scale, low-latency payment risk scoring system for a global fintech platform. The system must process 10k+ QPS with a P99 latency under 50ms. Address the end-to-end ML lifecycle: specifically, how you handle real-time feature engineering (velocity features), extreme class imbalance, and the inherent 30-90 day label delay (delayed feedback loop). Your design should include robust data and monitoring pipelines to detect adversarial drift and ensure system reliability via fallback mechanisms. - Real-Time Email Spam Detection System
Design a high-scale, real-time spam detection system for a global email provider. The system must process over 100,000 emails per second with a P99 latency under 50ms. Focus on a multi-stage architecture that balances heavy text-based deep learning with lightweight metadata-based filtering. Detail how you would handle adversarial attacks (e.g., character obfuscation), the cold-start problem for new senders, and the infrastructure required for high-precision model calibration and daily retraining. Address the critical trade-off between false positives and false negatives in a production environment. - Scalable Toxic Content Detection System
Design an end-to-end toxic content detection system for a high-traffic social media platform (1B+ posts/day). The system must handle real-time automated moderation with low latency (<150ms) while minimizing false positives to protect user expression. Your design should detail the data ingestion strategy, the model architecture for semantic understanding, techniques for handling adversarial text, and a robust evaluation framework that incorporates human-in-the-loop feedback and fairness auditing. - Real-Time Online Fraud Detection System
Design a high-scale, real-time fraud detection system for a global payment processor. The system must handle 10k+ QPS with sub-100ms P99 latency while minimizing both financial loss and false positives for legitimate users. Address the challenges of extreme class imbalance (0.1% fraud), significant label delay (30-90 days for chargebacks), and the need for near real-time feature updates (velocity signals). Explain your choice of model architecture, feature engineering strategy (online/offline consistency), and how you would evaluate and monitor the system in an adversarial environment where fraud patterns evolve rapidly. - Scalable Misinformation & Fake News Detection System
Design a high-throughput system to detect and mitigate the spread of fake news on a global social media platform. Your design should address: 1) Handling 100k+ QPS with low-latency constraints, 2) Mitigating extreme class imbalance and adversarial content evasion, 3) Integrating human-in-the-loop feedback with automated retraining, 4) Defining multi-stage model architectures that balance computational cost with classification accuracy, and 5) Ensuring system reliability and explainability for moderation decisions. - Scalable Content Moderation System
Design a high-scale content moderation system for a global social media platform. The system must process 100M+ text and image uploads per day with a P99 latency of under 200ms. Your design should cover the end-to-end ML lifecycle, including fast-path filtering, multi-modal scoring models, human-in-the-loop workflows for active learning, and strategies for handling adversarial content and data drift. Address how you would balance precision and recall while managing the costs of inference and human review. - Large-Scale Adversarial Spam Detection System
Design a high-throughput spam detection system capable of processing billions of messages daily. The system must maintain a P99 latency under 50ms while balancing extreme class imbalance and adapting to rapidly evolving adversarial attacks. Focus on the end-to-end architecture from real-time feature engineering (sender reputation, content signals) to model training/serving, and explain how you would handle delayed labels from user feedback and ensure the system minimizes false positives for high-priority legitimate communication. ---
🤖 LLMs & Foundation Models
- Large-Scale Enterprise RAG Chatbot System
Design a high-scale, retrieval-augmented generation (RAG) chatbot system for an enterprise corpus of 10 million documents. The system must support 100 million DAU with sub-second response times. Detail the end-to-end ML lifecycle, specifically focusing on multi-stage retrieval strategies, latency optimization for LLM inference (quantization, caching), handling data freshness, and implementing robust evaluation frameworks (e.g., RAGAS) to mitigate hallucinations. Address the production trade-offs between model size, retrieval accuracy, and operational cost. - Large-Scale Generative AI Chatbot System
Design a high-scale conversational AI system similar to ChatGPT. The system must support millions of concurrent users, provide sub-second initial responses (TTFT), and maintain high factual accuracy despite a static knowledge cutoff. Detail the end-to-end lifecycle including data cleaning of multi-terabyte crawls, model alignment using preference learning (RLHF/DPO), retrieval-augmented generation (RAG) for real-time grounding, and serving optimizations like KV-caching and continuous batching to handle high QPS on distributed GPU clusters. ---
🔬 ML Infrastructure & Platforms
- Real-Time Marketplace Surge Pricing System
Design a high-scale dynamic pricing system for a global ride-sharing platform. The system must process millions of real-time events to calculate surge multipliers at a granular geographic level (e.g., H3 hexagons). Focus on the end-to-end ML lifecycle: from streaming data ingestion and spatial-temporal feature engineering to a low-latency serving architecture. Address specific marketplace challenges such as feedback loops, switchback testing for online evaluation, and maintaining marketplace equilibrium under extreme demand volatility. - Unified ML Feature Store & Data Platform
Design a high-scale data platform capable of orchestrating both batch and streaming pipelines for a real-time recommendation system. The system must handle over 1M events per second, provide a unified interface for feature engineering to eliminate training-serving skew, and support low-latency (<10ms) feature retrieval for online inference. Detail the architecture for point-in-time correct training set generation, the integration of a feature store, and how you ensure data quality and reliability across the offline and online paths. - Stock Price Forecasting System
Design a high-scale machine learning system to predict next-day adjusted closing prices for a universe of 10,000+ global equities. Your design should emphasize the prevention of temporal data leakage, handle non-stationary financial time-series data, and describe a robust backtesting framework. Detail the end-to-end architecture from data ingestion of OHLCV feeds to batch inference, including strategies for handling market regime shifts and monitoring model performance against financial benchmarks like the Sharpe Ratio. - Autonomous Vehicle Perception System Design
Design a real-time, 3D object detection system for an autonomous vehicle fleet. The system must process multi-camera feeds at <30ms latency on edge hardware. Detail the end-to-end ML lifecycle, focusing on a scalable 'Data Engine' for active learning, an auto-labeling pipeline using offline multi-sensor fusion, and strategies for ensuring temporal consistency and safety-critical reliability. Explain your choices for model architecture (e.g., BEV-based vs. image-space) and how you handle the transition from cloud training to edge deployment including quantization and shadow mode validation. - Intelligent Adaptive Rate Limiter
Design an intelligent rate-limiting system for a global-scale ML inference API (e.g., Search or Recommendations). The system must differentiate between legitimate high-burst users and malicious scrapers or DDoS actors. Focus on achieving sub-2ms decision latency while handling 500k+ QPS. Detail the data pipelines for real-time feature extraction, the model architecture for risk scoring, and how to minimize false positives through offline/online evaluation strategies. Explain how you would manage the trade-off between system protection and user experience using an ML-driven dynamic thresholding approach. - Large-Scale Social Link Prediction System (People You May Know)
Design a high-scale 'People You May Know' (PYMK) recommendation system for a social network with over 1 billion users. Your design should handle massive graph data, addressing the challenges of candidate retrieval (Stage 1) and precision ranking (Stage 2). Detail how you would implement a low-latency serving architecture (P99 < 150ms) and a robust data pipeline that handles real-time friendship updates. Focus on feature engineering for graph-based signals, handling class imbalance in training, and defining the success metrics for business growth and system reliability. - Large-Scale Multi-Modal Image Search System
Design a high-scale image search system capable of handling 100 million images. The system must support both text-to-image and image-to-image queries with sub-200ms P99 latency. Your design should detail the multi-modal representation learning approach, the architecture for approximate nearest neighbor (ANN) search at scale, and how you ensure consistent embedding spaces between training and serving. Address data ingestion for billion-scale corpora and how you handle the reliability of the vector retrieval path. - Real-Time Video Anomaly Detection System
Design a high-scale, real-time video surveillance system capable of detecting anomalous activities across 10,000+ camera streams. The system must process high-resolution temporal data with sub-2-second end-to-end latency. Detail your approach to handling massive data throughput, the choice of ML paradigm (supervised vs. unsupervised) given the rarity of anomaly labels, the trade-offs between edge and cloud compute, and how you ensure system reliability and model freshness in changing physical environments (e.g., lighting, weather). - Scalable Enterprise Document Classification System
Design a high-scale document classification system capable of processing 10 million diverse documents (PDFs, images, emails) per day for an automated business workflow. The system must categorize documents into 50+ classes with a P99 latency under 500ms. Your design should address the full ML lifecycle including OCR integration, handling long-form text, class imbalance in training data, and a strategy for ensuring online model reliability and monitoring for concept drift. - Large-Scale Visual Similarity & Search System
Design a high-scale visual similarity system for a global e-commerce platform with a 100M+ item catalog. The system must support 'search-by-image' and 'similar product' recommendations with a P99 latency under 200ms. Your design should cover end-to-end data ingestion, embedding generation using deep vision models, efficient approximate nearest neighbor (ANN) retrieval at scale, and strategies for handling high QPS. Emphasize how you handle data freshness, model evaluation (online vs. offline), and the infrastructure required to serve and monitor these models in a production environment with constant catalog updates. - Large-Scale Privacy Redaction for Geospatial Imagery
Design a machine learning system to automatically detect and blur sensitive PII, specifically faces and license plates, in a global corpus of billions of high-resolution 360-degree street-level images. The system must prioritize near-perfect recall for privacy compliance while maintaining high precision to preserve the utility of the maps. Your design should detail a distributed batch-processing architecture, handle geometric distortions in spherical imagery, and explain how to manage global variations in license plate formats and hard negatives like statues or billboards. Address the trade-offs between processing throughput, inference cost, and model accuracy at petabyte scale. - Real-Time Financial Signal Generation System
Design a high-scale machine learning system to predict short-term equity price movements (e.g., 1-5 minute horizon) for a universe of 5,000 stocks. The system must process real-time market data feeds, perform feature engineering with minimal latency, and provide directional signals with a P99 latency of less than 50ms. Address specific challenges such as non-stationary data, prevention of look-ahead bias in the data pipeline, backtesting strategies, and the design of a robust online/offline feature store to maintain consistency.
|