AI System DesignAI Security and GuardrailsMarketplace Trust and Safety
How to Design a Marketplace Firearm Listing Detection System
Question 3 of 47 · Updated
On this page
- 1. Frame the business problem and define policy first
- 2. Requirements and scope
- Functional requirements
- Non-functional requirements
- 3. Estimate scale and processing demand
- 4. High-level architecture
- 5. Listing ingestion and secure data handling
- 6. Build an appropriate training and evaluation dataset
- 7. Multimodal model design
- Text assessment
- Image assessment
- Multimodal aggregation
- 8. Policy engine and human review
- 9. Data model and consistency
- 10. Evaluate detection under class imbalance
- Worked example: why base rates matter
- 11. Practical implementation: tested evaluation metrics
- 12. Evaluate the complete decision pipeline
- 13. Reliability, retries and degradation
- 14. Model release and continuous improvement
- 15. Security, policy compliance and responsible governance
- 16. Scalability and cost trade-offs
- 17. Interview-ready answer
- References and research transparency
Build a multimodal trust-and-safety system that evaluates the entire listing, distinguishes potentially prohibited sales from benign content, and routes uncertain or high-impact decisions to trained human reviewers. Use machine learning to prioritize and support moderation, not as an autonomous legal decision-maker. The system must prevent prohibited listings from becoming discoverable, minimize erroneous restrictions on legitimate sellers, and preserve an auditable path to correction and appeal.
The source interview question is: How would you create a system to detect if a firearm is listed on a marketplace?
This is a proposed defensive marketplace moderation architecture. It is not a description of a particular company's internal moderation systems. Workload assumptions and numerical examples are hypothetical; they are not actual detection thresholds, measured classifier accuracy, or operational rules of any marketplace. This discussion deliberately focuses on safety, reliability and evaluation rather than ways to circumvent controls.
1. Frame the business problem and define policy first#
An image classifier that recognizes an object is not the same as a system that decides whether a listing violates marketplace policy. The latter must consider the listing's purpose, the applicable policy version, the market where the listing is offered, and the evidence available to the reviewer.
Assume the marketplace prohibits firearm sales under its own rules. Its legal and trust-and-safety teams must define the exact scope of that prohibition before ML engineering begins. Do not infer a legal prohibition from the classifier, or infer that an item is permitted merely because local law allows it. A marketplace can impose restrictions beyond legal minimums. The policy must specify who is authorized to make exceptions and when a listing should be restricted, reviewed or reinstated.
Define distinct outcomes:
- Permitted: available evidence supports publication under the applicable policy.
- Requires review: evidence is incomplete, ambiguous, conflicting or outside the model's validated domain.
- Policy violation confirmed: an authorized decision process establishes that the listing violates the applicable policy.
- Processing unavailable: evaluation could not be completed because an input or dependency failed.
Treat these as different states, not four labels for the same classifier. A model score estimates a statistical target; a policy decision combines evidence and procedural requirements. Ambiguous cases should remain non-public until the required review is completed. A temporary hold is not a finding of wrongdoing.
Separate the detection objective (finding listings needing safety assessment) from the enforcement objective (applying the correct policy action). Otherwise it becomes difficult to diagnose whether a bad outcome came from the data, a model, the policy engine or the review procedure.
2. Requirements and scope#
Functional requirements#
- Accept new listings and material listing revisions containing text, images and structured metadata.
- Validate uploads, create a stable revision ID and assess each revision before it becomes publicly discoverable.
- Use text and image analysis as complementary sources of evidence; preserve uncertainty when either modality is unavailable.
- Maintain a reviewer workflow with relevant evidence, policy versions, decision reasons and appeal support.
- Apply approved decisions consistently to search, catalog, feeds and other public surfaces.
- Support re-evaluation when a policy changes or a new model version is approved.
- Record every important moderation decision with sufficient provenance for an authorized audit.
Non-functional requirements#
| Dimension | Proposed design objective |
|---|---|
| Safety | No unassessed revision becomes publicly discoverable |
| Responsiveness | Acknowledge listing creation promptly without waiting for expensive inference |
| Reliability | Preserve moderation state through retries, worker failures and deployments |
| Consistency | A decision applies to exactly the revision assessed |
| Privacy | Collect and retain only necessary evidence, with restricted access |
| Fairness | Evaluate false restrictions and missed violations across relevant cohorts |
| Observability | Measure detection quality, review delays, decision integrity and service health |
| Governance | Version the model, policy, dataset and review process independently |
Separate the latency of the listing creation API from moderation time and human review turnaround. The creation API can acknowledge a successfully stored submission with a pending status. That is not approval. Human review may take longer than automated inference, so the system should provide transparent status updates and appropriate support channels without exposing sensitive internal detection logic.
3. Estimate scale and processing demand#
Suppose a marketplace receives 1 million listing creations or material revisions per day, each with an average of three images. Assume an illustrative peak-to-average ratio of five, and an average of 400 KB per uploaded image.
- Average revision ingestion: 1,000,000 / 86,400 = about 11.6 revisions per second.
- Peak revision ingestion: about 58 revisions per second under the assumed traffic profile.
- Average image workload: 3 million / 86,400 = about 34.7 images per second.
- Peak image workload: about 174 images per second before retry or replay overhead.
- Raw image payload: 3 million × 400 KB = approximately 1.2 TB per day in decimal units before replication, compression, retention policies and metadata.
- If each revision produces 2 KB of decision and job metadata, the base metadata volume is about 2 GB per day, excluding indexes, audit history and duplicated records.
These numbers do not tell us how many accelerator instances we need. Benchmark inference on representative image sizes and text lengths, including preprocessing, batching, network transfer and tail latency. The required worker count depends on measured throughput and the workload distribution. Include headroom for failures, policy-driven reprocessing and backlog recovery.
Human review is also a capacity constraint. If, in a purely hypothetical planning scenario, 2,000 cases require review each day and each takes three minutes of active reviewer time, the workload is 100 reviewer-hours per day. At six productive review hours per shift, that is approximately 17 reviewer-shifts before allowances for breaks, training, quality audits, appeals and peak demand. Measure real handling times and queue arrivals before staffing.
The automated system and human team must be planned together. A model with good offline recall but an unmanageable false-positive queue can produce unsafe delays and unfair seller outcomes.
4. High-level architecture#
Use an asynchronous, revision-aware moderation workflow. Keep raw media, model inference and public visibility decisions in separate services with explicit contracts.
Seller / listing submission
|
v
Authenticated listing API
|
+--> Restricted media storage
|
+--> Listing DB: revision + PENDING state
| |
| Transactional outbox
| |
v v
Status API Durable job queue
|
Input validation
|
+----------+----------+
| |
Text assessment Image assessment
| |
+----------+----------+
|
Evidence / uncertainty aggregation
|
Versioned policy decision service
|
+----------+----------+
| |
Approved action Human review queue
| |
+----------+----------+
|
Revision-aware decision commit
|
Visibility projection / search index
|
Public catalog surfaces
Reports and appeals --> Authorized review --> Corrective decisions
Adjudicated feedback --> Dataset QA --> Training --> Registry --> EvaluationThe public catalog consumes only eligible decisions. It must not read directly from an unmoderated upload table or assume that submission success means publication. The search index, recommendations and cached product pages must enforce the same visibility state. Use a single authoritative decision contract rather than implementing different safety rules in every downstream service.
This differs from the Discover Weekly case study: recommendation ranks items that are already eligible for presentation; marketplace moderation establishes eligibility itself. A high recommendation score cannot override a safety restriction.
5. Listing ingestion and secure data handling#
A listing submission creates an immutable revision record. The listing ID represents the product entry, while the revision ID identifies the precise content assessed. Any material edit creates a new revision requiring evaluation.
An example event schema includes:
- event_id, listing_id, revision_id and submission_time;
- references to validated media objects and structured listing fields;
- market and relevant policy context;
- job type, event schema version and correlation ID.
Keep media in private object storage. Validate content type and actual file structure rather than trusting the filename or browser headers. Enforce resource limits on decoding, sandbox or isolate media processing, scan uploads as appropriate, and prevent unauthorized URL fetching. Strip unnecessary metadata according to the evidence-retention policy. Do not give the model worker unrestricted access to seller profiles or arbitrary storage buckets.
Use the transactional outbox pattern: write the revision and an outbox event in the same database transaction, then relay that event to the durable queue. This avoids the classic failure in which a listing is persisted but its moderation job is never enqueued.
Expect at-least-once delivery. Deduplicate jobs using stable identifiers, persist intermediate state where needed, and make downstream writes idempotent. A repeated queue message must not cause duplicate enforcement, duplicate seller notifications or repeated creation of review cases.
Return an acknowledgment containing listing ID, revision ID and a pending status. Never publish raw unassessed data as an intermediate result.
6. Build an appropriate training and evaluation dataset#
Use lawfully obtained, purpose-limited marketplace listing data with authorized access. Historical moderation decisions may be a starting point, but they are not inherently correct ground truth. Reviewers may have used older policy definitions, made inconsistent decisions or evaluated incomplete evidence.
Define a labeling guide with examples of permissible and prohibited content, review-needed cases, incomplete input and ambiguous context. The guide is an internal governance artifact maintained by authorized safety teams. Do not use protected characteristics or unrelated personal information as a substitute for evidence about the listing.
For reliable supervision:
- Sample historical listing revisions from different time periods, languages, regions and catalog categories.
- Include representative legitimate listings and adjudicated policy violations, not only content that a previous classifier flagged.
- Retain the policy version and evidence available at decision time.
- Use trained reviewers for annotation, double-label a representative sample, and adjudicate disagreements.
- Track label provenance, annotation uncertainty and whether appeals changed the original decision.
- Maintain separate training, calibration, validation and final test datasets.
Avoid leakage between splits. Near-duplicate media, revisions of the same listing and related records should not be distributed randomly across train and test when that makes evaluation unrealistically easy. Use group-aware and chronological evaluation where appropriate. Keep a future-period holdout to assess changes in listing distribution.
A class-balanced training sample may help model learning, but its positive fraction is not necessarily the production prevalence. Preserve a representative evaluation set for estimating false-positive counts and reviewer workload. Document sampling and weighting when estimating production metrics from deliberately enriched datasets.
Review datasets for privacy, consent or other lawful basis as applicable, retention restrictions, annotation quality, coverage gaps and known limitations. Datasheets and model cards help record these decisions. Avoid sourcing examples from unsafe or unauthorized transactions.
7. Multimodal model design#
Text assessment#
Use a supervised text encoder or classifier trained on listing titles, descriptions and permitted structured information. Its job is to estimate whether the evidence warrants further policy assessment, not to determine whether a seller has committed a crime.
Start with a simpler text baseline for comparison, then evaluate a pretrained language encoder fine-tuned on appropriately labeled marketplace data. Multilingual support should be assessed with representative native-language labels, rather than assuming that translating everything into one language preserves meaning. Structured attributes may provide useful context, but they can be incomplete or incorrect.
Image assessment#
Use a pretrained vision encoder adapted to a curated, policy-labeled image dataset. Treat visual classification as evidence of possible relevant content, not evidence that an actual prohibited sale is occurring. Validate on different image qualities and benign catalog content. Images alone cannot reliably establish legal status, intent, ownership or whether a transaction is occurring.
A listing may have multiple images, so aggregate information at listing level rather than making a separate irreversible enforcement decision for each image. Missing, invalid or unreadable images require explicit handling and must not silently become negative evidence.
Multimodal aggregation#
Compare three approaches:
| Approach | Advantage | Limitation |
|---|---|---|
| Text-only baseline | Lower cost and simpler debugging | Misses information available only visually |
| Image-only baseline | Captures visual evidence | Cannot establish listing purpose from image alone |
| Late fusion of separately trained models | Modular, independently measurable and easier to operate | May miss interactions between modalities |
| Joint multimodal model | Can learn contextual relationships across text and images | More expensive training and harder diagnosis |
Late fusion is a reasonable initial architecture because individual components can be benchmarked and versioned. A learned fusion model can combine modality-level evidence and explicit missing-input indicators. Compare with a joint encoder on a held-out dataset to determine whether the extra complexity is justified.
A model trained for general visual-language similarity, such as the approach described in CLIP research, is useful as a representation-learning reference. It does not automatically become a reliable policy classifier. Domain adaptation, calibrated uncertainty, and policy-specific evaluation are essential.
Do not assume independent evidence sources or multiply their probabilities as if they were independent. Text and images may be correlated. Evaluate the combined output on representative listing-level labels and measure errors when one modality is unavailable.
Calibration converts model outputs into better estimates of empirical likelihood for a specified target and data distribution. For example, temperature scaling is a post-training calibration technique for classifier logits. Assess calibration on a held-out calibration set and monitor it after distribution changes. A calibrated score is still not a final policy judgment.
Production decision thresholds and detailed internal classifier rules should be governed and tested by authorized safety staff; this article does not specify deployable enforcement cutoffs. The decision service should consider confidence, input completeness, policy applicability and the need for human adjudication.
8. Policy engine and human review#
Maintain the applicable marketplace policy separately from the model. A model predicts evidence categories or review priorities; the policy engine maps evidence and procedural requirements to allowed actions. This separation supports policy updates without unnecessarily retraining every model.
Use explicit policy versions. A reviewer should know which rules apply to the listing being evaluated. If a policy or model version changes during an in-flight assessment, the system must have a defined compatibility rule or require re-evaluation.
A reviewer interface should provide the relevant listing revision, authorized evidence, applicable policy guidance, prior adjudicated decisions where appropriate, and a way to request specialist review. It should also support a clear reason code and a structured explanation. Limit irrelevant personal data to reduce bias and protect privacy.
Avoid automation bias: a model recommendation should not be treated as definitive. Give reviewers the ability to disagree, record why, and escalate difficult cases. Use quality sampling, periodic independent review, reviewer agreement checks and appeal outcomes to assess the review process.
For high-impact decisions, apply whatever independent approval or specialist escalation the policy requires. A seller notice should explain the applicable rule and the available appeal or correction route at an appropriate level. It need not expose proprietary model features, exact scores or security-sensitive detection internals.
If a case is appealed, create a new decision record rather than overwriting the old record. Preserve the original evidence and applicable policy version subject to retention restrictions. An overturned decision should trigger restoration of eligible content and downstream cache/index correction. Appeals also provide feedback, but they are not a representative random sample of all decisions.
9. Data model and consistency#
A practical relational schema can separate listing state, assessments, and final decisions:
| Record | Key | Purpose |
|---|---|---|
| Listing | listing_id | Owner, current revision and authoritative visibility |
| Listing revision | revision_id | Immutable submitted content reference and market |
| Assessment | assessment_id | Revision, model version, evidence references and processing status |
| Policy decision | decision_id | Revision, policy version, authorized action and reason |
| Review case | case_id | Revision, assignment, workflow state and adjudication |
| Appeal | appeal_id | Contested decision, evidence and resolution |
| Outbox event | event_id | Durable delivery of state changes |
Use explicit foreign keys and a unique idempotency key for each logical assessment or decision operation. The exact schema depends on transaction semantics and database partitioning, but avoid mixing a mutable seller-facing listing record with an immutable moderation audit trail.
Consider this concurrency scenario: revision A is submitted; the seller submits revision B before the assessment of A returns. A decision about A must never approve B. Compare the assessed revision to the active revision in the authoritative transaction before applying any visibility change. A stale assessment can be retained for audit if permitted, but it cannot mutate the current listing.
Likewise, a delayed worker must not reverse a newer authorized decision. Use optimistic concurrency or compare-and-set semantics with a monotonically increasing decision version. If a write fails its precondition, reload state and handle the conflict explicitly.
Every public index event should contain the revision ID and decision version. Consumers must reject stale updates and remove restricted content. Reconcile the catalog with authoritative moderation state periodically. A stale search cache must not become an alternative source of publication authority.
10. Evaluate detection under class imbalance#
Accuracy is a poor primary metric when prohibited listings are rare. A system that approves everything could achieve high accuracy on a dataset where almost all listings are legitimate, while missing every violation.
Define positives using adjudicated policy labels and predicted positives as the population selected for the evaluation action, such as review. Keep the meaning of positive consistent across metrics.
- True positive (TP): an actual policy violation correctly selected.
- False positive (FP): a legitimate listing incorrectly selected.
- False negative (FN): an actual violation missed.
- True negative (TN): a legitimate listing correctly not selected.
Precision = TP / (TP + FP). It measures how much of the selected population is actually positive.
Recall = TP / (TP + FN). It measures how many adjudicated violations are captured.
False-positive rate = FP / (FP + TN). It measures the fraction of legitimate listings incorrectly selected.
F1 = 2 × TP / (2 × TP + FP + FN). It summarizes precision and recall but does not capture the different harms of missed violations and unnecessary restrictions.
Worked example: why base rates matter#
Suppose an independently adjudicated synthetic test set has 100,000 listings: 1,000 policy violations and 99,000 legitimate listings. Suppose the model selects 900 true violations and 990 legitimate listings. It misses 100 violations, and correctly leaves 98,010 legitimate listings unselected.
| Metric | Hypothetical result |
|---|---|
| Precision | 900 / 1,890 = 47.62% |
| Recall | 900 / 1,000 = 90% |
| False-positive rate | 990 / 99,000 = 1% |
| F1 | 1,800 / 2,890 = 62.28% |
Even with a small false-positive rate, more than half of the selected cases in this synthetic example are legitimate. These figures illustrate class imbalance only; they are not target thresholds or measured performance of any deployed system. Whether a selected legitimate listing is merely reviewed or improperly restricted depends on downstream handling.
Use precision-recall curves and area under the PR curve to compare models on an imbalanced test set. PR-AUC depends on prevalence, so comparisons across datasets require care. ROC-AUC can provide additional discrimination information but should not replace operational error counts and precision-recall analysis.
Measure false-positive and false-negative estimates with confidence intervals. Audit a representative sample of listings outside the existing review queue to avoid estimating recall solely from already selected cases. Account for sampling design when extrapolating error rates to the full catalog.
11. Practical implementation: tested evaluation metrics#
The following standard-library Python example computes metrics from independently adjudicated confusion-matrix counts. It is deliberately an evaluation helper, not a deployed moderation decision function. It returns None when a metric is undefined instead of silently converting missing evidence into perfect or zero performance.
PYTHONdef metrics(tp, fp, fn, tn): if any(type(x) is not int or x < 0 for x in (tp, fp, fn, tn)): raise ValueError('counts must be nonnegative integers') def ratio(a, b): return a / b if b else None return { 'precision': ratio(tp, tp + fp), 'recall': ratio(tp, tp + fn), 'fpr': ratio(fp, fp + tn), 'f1': ratio(2 * tp, 2 * tp + fp + fn) } m = metrics(900, 990, 100, 98010) assert abs(m['precision'] - 900 / 1890) < 1e-12 assert m['recall'] == .9 assert m['fpr'] == .01 assert abs(m['f1'] - 1800 / 2890) < 1e-12 assert metrics(0, 0, 0, 20) == { 'precision': None, 'recall': None, 'fpr': 0., 'f1': None } assert metrics(5, 0, 0, 20) == { 'precision': 1., 'recall': 1., 'fpr': 0., 'f1': 1. } assert metrics(0, 0, 5, 0) == { 'precision': None, 'recall': 0., 'fpr': None, 'f1': 0. } try: metrics(-1, 0, 0, 0) except ValueError: pass else: raise AssertionError('negative count accepted') print('8 checks passed', m)
The implementation and all eight checks were executed locally. The returned metrics for the synthetic example were precision approximately 0.47619, recall 0.9, false-positive rate 0.01 and F1 approximately 0.62284. The checks include undefined denominators, a perfect classifier case, missed positives and invalid input. They establish arithmetic correctness on these inputs, not detection model quality. Runtime and auxiliary memory are constant for a fixed four-count input, ignoring arbitrary-precision integer arithmetic.
12. Evaluate the complete decision pipeline#
A detector's recall alone does not describe system safety. If it flags a listing but the catalog still shows it due to a stale index, the system has failed. If a correct human decision is applied to the wrong revision, the system has failed even if the model was accurate.
Track three layers of metrics:
Model quality: representative precision and recall, calibration error, per-language and per-category performance, missing-input outcomes and confidence intervals.
Moderation outcomes: confirmed violation exposure, incorrect restriction rate, appeal overturn rate, time to resolution, reviewer agreement, sampled audit quality, and consistency of policy application. Use clearly defined denominators. An appeal overturn percentage is conditional on the population that appealed; it cannot directly estimate the error rate for all sellers.
Infrastructure quality: submission-to-assessment latency, queue age, dependency failures, retry volume, stale decision rejection count, moderation-state reconciliation errors, cache/index propagation latency, and unauthorized visibility incidents.
Build dashboards using aggregates and restricted identifiers. Protect small-cohort information that could expose personal data. A sudden increase in confirmed violations might indicate a distribution change, a policy change, improved detection or a labeling issue. Investigate before automatically retraining.
13. Reliability, retries and degradation#
| Failure | Defensive behavior |
|---|---|
| Media preprocessing fails | Preserve pending state; retry safely or request appropriate review |
| Inference service is unavailable | Pause affected automated decisions; retain durable pending jobs |
| Queue consumer crashes | Redeliver jobs and use idempotent decision commits |
| Policy service cannot resolve applicable policy | Hold for authorized resolution rather than assuming permission |
| Reviewer capacity is exceeded | Escalate staffing and backlog incident; do not bypass required review |
| Stale decision arrives | Reject visibility mutation for the wrong revision or decision version |
| Search or cache propagation fails | Reconcile against the authoritative visibility state and restrict unsafe exposure |
| Bad model deployment | Halt rollout; restore compatible validated model and review affected decisions |
Use bounded retries with exponential backoff and jitter. Distinguish transient dependency errors from invalid inputs. Repeatedly failing jobs should enter a monitored dead-letter process with an accountable owner; moving them out of the primary queue does not resolve the listing's moderation status.
Apply backpressure when inference or review is saturated. Keep the seller-facing acknowledgment service separate from resource-intensive model workers, but enforce the pending visibility contract throughout. A service outage must not turn unassessed listings into public content.
Use a recovery runbook with documented data ownership, incident escalation, backlog reconciliation and audit requirements. Test worker crashes, duplicate messages, reordered events, outdated revisions and index failures in staging. Measure recovery behavior during load tests rather than promising exactly-once delivery from a queue technology.
14. Model release and continuous improvement#
Keep a model registry with the training data snapshot, feature preprocessing, calibration artifact, intended use, evaluation results and model version. Bind each assessment to the exact deployed bundle.
Before release, evaluate on a temporal holdout and representative legitimate content. Compare new and existing models under the same adjudicated test set. Assess false restrictions, missed violations and reviewer capacity implications as well as aggregate metrics.
Use shadow evaluation where feasible: run the candidate model alongside an approved production moderation workflow without giving the candidate authority over public visibility. Investigate disagreements through authorized review. A staged deployment should preserve the approved safety floor; experiments must not knowingly expose prohibited content to measure engagement.
Use controlled replay of authorized historical data for regression testing. Limit access to sensitive evaluation material and document where the model has not been validated. If quality degrades, roll back the compatible inference bundle and reassess affected revisions as required. Rolling back the model alone does not automatically undo decisions already committed under it.
For continuous improvement, sample decisions, inspect independently adjudicated errors, incorporate corrected labels, and monitor changes in listing distributions. Reports from users are useful supplementary signals, but malicious or mistaken reports should not directly trigger irreversible restrictions. Rate-limit abuse of reporting and route reports into the same accountable assessment workflow.
15. Security, policy compliance and responsible governance#
Moderation systems process potentially sensitive user and seller content. Use least-privilege access, authenticated service identities, encrypted transport and storage, separated administrative roles, and tamper-evident or access-controlled decision auditing. Review access permissions regularly and remove them when no longer needed.
Protect reviewer tools from untrusted content. Treat listing text and images as data, not executable instructions. If a language model is used to assist with summaries, it should not receive unrestricted tool access or authority to alter moderation decisions. Validate structured model outputs and isolate untrusted media handling.
Retain evidence only for a documented purpose and period, subject to applicable legal and organizational requirements. Define deletion propagation, backup retention and handling of active disputes. Do not expose raw evidence or sensitive model details in ordinary application logs.
Assess potential disparities in model errors and reviewer actions across relevant, lawful evaluation cohorts. Where appropriate and legally permitted, measure fairness with a governed dataset rather than inferring personal characteristics from names, appearance or other unrelated proxies. Ensure an accessible correction and appeal process.
Marketplace policy and law are distinct. The responsible legal and compliance teams must verify current obligations in each applicable jurisdiction, including any reporting, notification, retention or procedural requirements. This article does not provide jurisdiction-specific legal advice or claim that any classifier guarantees legal compliance. Use approved human escalation channels for serious safety concerns.
16. Scalability and cost trade-offs#
Separate queues or worker pools for media validation, text inference, image inference and review preparation, because their resource profiles differ. Use bounded batches to improve accelerator utilization while preserving the service latency objective. Partition processing by appropriate stable keys and observe partition skew.
Store media once and pass restricted references between services instead of repeatedly copying large payloads. Version intermediate assessments and reuse them only when content identity, model version, policy context and retention requirements permit. Do not reuse an old decision merely because two listings appear similar.
| Engineering choice | Trade-off |
|---|---|
| Synchronous inference | Simpler immediate response, but couples API availability to model dependencies |
| Asynchronous inference | Better failure isolation and burst handling, but requires explicit pending state |
| Independent modality models | Easier monitoring and updates, but additional aggregation complexity |
| Joint multimodal model | Potentially richer contextual understanding, but larger operating cost |
| Human review | Better handling of ambiguity and appeals, but finite capacity and variable latency |
| Versioned immutable decisions | Strong auditability, but increased storage and retention complexity |
Estimate total cost per correctly resolved listing, including inference, storage, moderation staff, appeals, operational incidents and maintenance. A cheap model that floods the review queue can cost more overall. Do not optimize compute cost at the expense of unresolved safety cases or systematic false restrictions.
17. Interview-ready answer#
I would first clarify which listings the marketplace prohibits and how the safety team adjudicates ambiguous cases. Each new or materially edited listing would receive a revision ID and remain pending until an eligible moderation decision is committed. The ingestion service would securely store media and enqueue a durable job. Separate text and vision models would produce policy-relevant evidence and uncertainty, combined by a calibrated multimodal assessment service.
A versioned policy engine and trained reviewers would turn that evidence into accountable decisions with reasons and appeals. Revision-aware transactions and downstream reconciliation would prevent stale model results or search indexes from making unapproved content visible. I would evaluate on representative adjudicated data using precision, recall, false-positive rates, calibration and actual moderation outcomes, while planning reviewer capacity alongside compute capacity.
My key trade-off is reducing prohibited exposure without unjustly restricting legitimate listings. That requires an end-to-end system combining multimodal learning, careful data quality, resilient state management, human judgment and responsible policy governance — not just an image classifier.
References and research transparency#
This article uses the authorized offline research exception. These established primary research papers, official guidance and documentation references support the general technical methods. Their current availability and contents could not be live-verified in this session. No claims about specific marketplace detection implementations or current legal obligations are made.
- NIST — AI Risk Management Framework (AI RMF 1.0)
- Radford et al. — Learning Transferable Visual Models From Natural Language Supervision
- Guo et al. — On Calibration of Modern Neural Networks
- Saito and Rehmsmeier — The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets
- Gebru et al. — Datasheets for Datasets
- Mitchell et al. — Model Cards for Model Reporting
- Apache Kafka — Documentation
- OWASP — File Upload Cheat Sheet
- Google — Rules of Machine Learning: Best Practices for ML Engineering
References
- 1.
- 2.
- 3.Guo et al. — On Calibration of Modern Neural Networksproceedings.mlr.press
- 4.
- 5.
- 6.
- 7.Apache Kafka — Documentationkafka.apache.org
- 8.OWASP — File Upload Cheat Sheetcheatsheetseries.owasp.org
- 9.Google — Rules of Machine Learning: Best Practices for ML Engineeringdevelopers.google.com
Related questions
Explore other topics:Forward Deployed EngineeringMachine LearningMLOpsPython