Engineering Social Graph Features to Detect Spam Accounts

Last updated: November 29, 2026

Quick Overview

Propose graph-based features from Facebook's friend and messaging graph that separate spam accounts from real users, and explain how you would compute them at scale and keep them robust to evasion.

Meta
Machine Learning
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


Propose graph-based features from Facebook's friend and messaging graph that separate spam accounts from real users, and explain how you would compute them at scale and keep them robust to evasion.

Spammers can fake profile content but struggle to fake a realistic social graph, which is why graph features matter for Meta integrity. The interviewer wants concrete features, awareness of computational cost on billions of nodes, and adversarial thinking.

What the Interviewer Expects
  • Propose local structure features such as clustering coefficient and reciprocity
  • Use request behavior: acceptance rate and fan-out speed
  • Use neighbor label propagation or graph embeddings
  • Explain approximate computation at billion-node scale
  • Discuss evasion and leakage through neighbor labels
Key Topics to Cover
Graph features
Clustering coefficient
Label propagation
Graph embeddings
Adversarial robustness
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 compute clustering coefficients for high-degree nodes efficiently?
  • How do you avoid leaking labels through neighbors in training?
  • How would a spammer try to defeat these features?
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 graphs we can use (friendships, friend requests, messages, group co-membership), the label source and size, and the latency: is this at signup, at friend request time, or a daily bat...

Approach

Real users form tight, reciprocal communities built over time. Spam accounts send many requests to unconnected strangers quickly, with low acceptance. Features should capture those structural and temp...


Submit Your Answer
Markdown supported