Problem and Scope
Design an end-to-end machine learning system to detect ads that are selling weapons. The system should ingest ads from Web and Mobile, process text, images, and video (video details skipped for storage estimates), support multiple languages, and prioritize minimizing false negatives (i.e., high recall for weapon-selling ads). It must be updatable (retrain/deploy/validate), achieve ~99.9% availability with cost awareness, and scale to roughly 100K ads/day.
Start by confirming the core user journey, exclusions, success criteria, and the constraints that materially affect the architecture.
Requirements to Clarify
A strong answer should establish scope before choosing components.
Functional requirements:
- Track ads on Web and Mobile.
- Detect if an ad is selling weapons (text, images, video).
- Support multiple languages.
- API endpoints: Predict Ad (POST), Log Prediction (POST), Trigger Training (POST), Deploy Model (POST).
- Ingest data from existing Ad API.
- Minimize false negatives (high recall); balance precision to limit review load.
- Model performance tracked by precision/recall.
- Availability: 99.9% (cost-aware).
- Scalability: ~100K ads/day.
- Updatability: retrain, validate, deploy with canary/rollback.
- Online feature store: 1 month of ad data stored (NoSQL).
- Prediction logging throughput (as specified): 4/sec * 3600 entries per day (see scale section).
- Skip detailed video storage estimates for interview.
Non-functional requirements:
- Meet the online moderation latency budget and 99.9% availability under bursty ingestion
- Prioritize recall while maintaining a precision floor that keeps human-review volume operationally sustainable
- Support multilingual and multimodal inputs with measurable slice-level quality
- Provide explainable, auditable decisions, privacy controls, and a safe appeals path
- Detect drift and adversarial evasion and support canary deployment, rollback, and reproducible retraining
Scale and Capacity
Use the workload to justify storage, partitioning, caching, and reliability decisions. Clarify or challenge these assumptions rather than treating them as unquestionable facts:
- Ads/day: 100,000 ads.
- Peak arrival rate: input gives
10,000/3600-> ~2.8 QPS. (If interpreted differently, plan for up to 100 QPS headroom.) - Online prediction QPS target: plan for 5-100 QPS to handle bursts; p95 latency budget <500ms.
- Prediction logging: input states
4/Sec * 3600 entries per day. Literal interpretation = 4 * 3600 = 14,400 entries/day. If 4/sec sustained for full day: 4 * 86,400 = 345,600/day. Design to support at least 350K logged events/day. - Online feature store window: 1 month of ad data. If 100K ads/day -> ~3M ad records retained in online store.
- Storage and inference: model serving instances sized to keep 99.9% uptime with autoscaling; use GPU/CPU mix depending on model complexity.
Architecture Discussion
Walk through the important read and write paths, identify ownership boundaries, and explain how the design behaves when dependencies fail. Cover these areas explicitly:
- Multimodal ad ingestion, normalization, feature extraction, and content identity
- Text, image, metadata, and ensemble model architecture with multilingual coverage
- Recall-oriented thresholds, calibration, review capacity, and enforcement policy
- Low-latency serving, asynchronous enrichment, caching, and degraded behavior
- Training data, labeling, active learning, registry, validation, rollout, and rollback
- Adversarial robustness, explainability, privacy, auditing, and appeals
Follow-up Questions
Expect the interviewer to test the consequences of your choices. Practise answering these questions with a concrete decision, its benefit, and its cost:
- Which ad fields are available via the Ad API? (e.g., title, description, images, video links, seller metadata, contact info)
- Focus: Assess the candidate's answer to "Which ad fields are available via the Ad API? (e.g., title, description, images, video links, seller metadata, contact info)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Do we need real-time blocking or near-real-time flagging for review? (assume both: prediction API for instant decisions + async review flow)
- Focus: Assess the candidate's answer to "Do we need real-time blocking or near-real-time flagging for review? (assume both: prediction API for instant decisions + async review flow)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- What actions should follow a positive detection? (auto-take-down, escalate to human review, shadow block)
- Focus: Assess the candidate's answer to "What actions should follow a positive detection? (auto-take-down, escalate to human review, shadow block)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Acceptable latency for a prediction? (assume <500ms p95 for online)
- Focus: Assess the candidate's answer to "Acceptable latency for a prediction? (assume <500ms p95 for online)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Are ground-truth labels available and how frequently? (assume periodic labeling + user reports)
- Focus: Assess the candidate's answer to "Are ground-truth labels available and how frequently? (assume periodic labeling + user reports)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Any legal/regulatory requirements per region? (assume yes — must support audits and explainability)
- Focus: Assess the candidate's answer to "Any legal/regulatory requirements per region? (assume yes — must support audits and explainability)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- How to expand to other illicit goods (drugs, stolen property)?
- Focus: Assess the candidate's answer to "How to expand to other illicit goods (drugs, stolen property)" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Integrate user reports and feedback loops for online labeling.
- Focus: Assess the candidate's answer to "Integrate user reports and feedback loops for online labeling." for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Add adversarial robustness and content obfuscation detection (image steganography, text obfuscation).
- Focus: Assess the candidate's answer to "Add adversarial robustness and content obfuscation detection (image steganography, text obfuscation)." for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Region-specific policies and automated appeals workflows.
- Focus: Assess the candidate's answer to "Region-specific policies and automated appeals workflows." for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
- Add active learning to prioritize labeling uncertain examples to improve recall quickly.
- Focus: Assess the candidate's answer to "Add active learning to prioritize labeling uncertain examples to improve recall quickly." for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
Evaluation Rubric
MockMe evaluates the answer across the following dimensions. A complete answer should connect claims to requirements and explain consequential trade-offs.
- Requirements and scope (15%): Clarifies and prioritizes the required behavior for Track ads on Web and Mobile; Detect if an ad is selling weapons (text, images, video); Support multiple languages. Establishes the constraints that materially affect Detect Weapon Ads with ML, including Meet the online moderation latency budget and 99.9% availability under bursty ingestion; Prioritize recall while maintaining a precision floor that keeps human-review volume operationally sustainable. Strong evidence includes Separates the critical path from secondary features and resolves ambiguous requirements before choosing components.
- Architecture and interfaces (20%): Presents coherent ownership boundaries and end-to-end flows covering Multimodal ad ingestion, normalization, feature extraction, and content identity; Text, image, metadata, and ensemble model architecture with multilingual coverage; Recall-oriented thresholds, calibration, review capacity, and enforcement policy; Low-latency serving, asynchronous enrichment. Strong evidence includes Defines interfaces and traces important success, retry, and failure paths across the proposed components.
- Data and scaling (25%): Uses workload assumptions such as Ads/day: 100,000 ads; Peak arrival rate: input gives
10,000/3600-> ~2.8 QPS. (If interpreted differently, plan for up to 100 QPS headroom.) to justify capacity and partitioning decisions. Explains the data, state, or model strategy for Multimodal ad ingestion, normalization, feature extraction, and content identity; Text, image, metadata, and ensemble model architecture with multilingual coverage; Training data, labeling, active learning, registry, validation, rollout, and rollback. Strong evidence includes Quantifies a dominant workload, identifies the first bottleneck, and explains how the design evolves as that workload grows. - Reliability, correctness, and safety (20%): Explains concrete failure behavior, recovery, and operational safeguards for Adversarial robustness, explainability, privacy, auditing, and appeals; Meet the online moderation latency budget and 99.9% availability under bursty ingestion; Provide explainable, auditable decisions, privacy controls, and a safe appeals path. Strong evidence includes States the required correctness or consistency boundary and covers retries, partial failure, observability, and safe degradation.
- Communication and trade-offs (20%): Drives a structured discussion and compares consequential alternatives for Low-latency serving, asynchronous enrichment, caching, and degraded behavior; Training data, labeling, active learning, registry, validation, rollout, and rollback; Adversarial robustness, explainability, privacy, auditing, and appeals. Strong evidence includes Makes assumptions explicit, answers the question asked, and explains both the benefit and cost of major decisions.