Representing Listing Text for a Prohibited Items Classifier

Last updated: November 29, 2026

Quick Overview

Facebook Marketplace must detect listings for prohibited items such as weapons or drugs, often written with slang and misspellings. Compare TF-IDF n-grams with pretrained multilingual embeddings for representing title and description text.

Meta
Machine Learning
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


Facebook Marketplace must detect listings for prohibited items such as weapons or drugs, often written with slang and misspellings. Compare TF-IDF n-grams with pretrained multilingual embeddings for representing title and description text.

Text features for integrity on Marketplace face adversarial spelling, many languages and short texts. The interviewer checks whether you understand sparse versus dense representations and how to combine them robustly.

What the Interviewer Expects
  • Describe word and character n-gram TF-IDF and their strengths
  • Describe pretrained multilingual transformer embeddings such as XLM-R
  • Address obfuscation with character n-grams and normalization
  • Discuss combining text with image and seller features
  • Plan evaluation by language and by evasion pattern
Key Topics to Cover
TF-IDF
Character n-grams
Multilingual embeddings
Adversarial text
Text classification
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you handle a new slang term that appears this week?
  • When would you fine-tune the transformer instead of using frozen embeddings?
  • How do you keep inference cost manageable at Marketplace scale?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

I would ask which languages dominate, the average text length, latency and compute budget per listing, available labels per language, and whether images are also available, since many sellers put the ...

Approach

Sparse n-grams capture exact tokens and are cheap, interpretable and quick to update. Dense embeddings capture meaning across paraphrases and languages but are costlier and can miss deliberate misspel...


Submit Your Answer
Markdown supported