Detect Account Takeover After Suspicious Instagram Logins

Last updated: November 29, 2026

Quick Overview

Design an ML system that detects when an Instagram account has been taken over, both at login and in the minutes after, and triggers the right protective action. Cover signals, models, actions and the recovery loop.

Meta
ML System Design
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Medium

0

0

0 solved


Design an ML system that detects when an Instagram account has been taken over, both at login and in the minutes after, and triggers the right protective action. Cover signals, models, actions and the recovery loop.

Account takeover leads to scams sent to friends and creator accounts being held for ransom, a visible problem for Instagram. Interviewers check whether you separate login risk from post-login behavior, choose actions with low friction for real owners, and learn from recovery outcomes.

What the Interviewer Expects
  • Scores logins using device, location and credential context against the owner's history
  • Monitors post-login behavior for takeover patterns like email change and mass DMs
  • Uses step-up verification rather than outright blocks where possible
  • Builds labels from owner recovery claims and confirmed hacks
  • Designs around low latency on the login path
Key Topics to Cover
account takeover
login risk
behavioral anomaly
step-up authentication
recovery labels
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How do you handle a user who legitimately travels and logs in from a new country?
  • What signals reveal a SIM swap before the attacker changes the password?
  • How would you prioritize protection for high-follower creator accounts?
Sharpen Your Skills on Codemia

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

Practice ML System Design Problems
Sample Answer
Requirements
  • Two decision points: at login (under 150 ms) and continuous monitoring for the first hours of a new session.
  • Actions: allow, require 2FA or email code, require selfie video, lock sensitive setting...
High-Level Design
  1. Login risk model: features comparing this login to the owner's profile: new device, new country or ASN, distance from last login, password recently found in breach lists, failed attempts before...

Submit Your Answer
Markdown supported