Design Fake Account Detection

Free with account Updated Nov 16, 2026 · 17 min read
On this page

    Problem Description

    In this interview, we're going to design the system that finds fake accounts on a large social network, similar to how Facebook, Instagram or LinkedIn find accounts run by scripts and scammers instead of real people. People sign up with an email address or phone number, fill in a profile, add friends and start posting and messaging. Some sign-ups are fake: created in bulk to send spam, run scams or sell likes. The system checks each new account when it signs up and keeps watching what accounts do afterwards. For each account it decides whether to leave it alone, ask it to prove it's a real person (for example by confirming a phone number), or disable it. People whose account was disabled can appeal, a trust team reviews the appeals, and the system keeps learning from their decisions. You can use existing building blocks: an accounts service that runs sign-up and can challenge or disable an account, a stream of every action accounts take (sign-ups, friend requests, messages, posts), and a review tool for the trust team.

    Out of Scope

    • Hacked real accounts (account takeover) – a real person's account changing hands needs login signals, a different problem.
    • Harmful posts – judged per post by a content system, whoever posted them.
    • Building the phone check itself – the accounts service runs it; we only ask for it.
    • Bots that use the official API – registered apps follow separate developer rules.
    • Legal requests and law enforcement – handled by the trust team outside this system.

    Good Clarifying Questions

    1. How many sign-ups and accounts? – About 5 million sign-ups a day, of which about a third are fake, mostly made by scripts. About 2 billion active accounts, which take about 100 billion actions a day.
    2. What does each kind of mistake cost? – Disabling a real person is the worst: they lose their friends and photos and often leave. A phone check makes about 1 in 5 real people give up at sign-up, fewer later. A fake that gets through sends hundreds of spam friend requests and scam messages. The candidate decides how to weigh them.
    3. How fast must the sign-up check be, and what if it fails? – Under 200 ms, inside the sign-up form. If our system is down, people must still be able to sign up.
    4. What about fakes that look fine at sign-up? – Many wait, then start sending friend requests and messages within hours. We should act within 5 minutes of the first suspicious burst.
    5. Do fakes act alone? – Usually not: one operator creates hundreds of accounts, often from the same devices, phone number ranges and networks, and changes tactics within weeks when blocked.

    Requirements

    Functional Requirements

    1. Check Every Sign-Up – When someone signs up, the system allows the account, asks it to confirm a phone number, or disables it.
    2. Keep Watching Accounts – As accounts act, the system checks them again and challenges or disables the ones that look fake.
    3. Review Appeals – People can appeal when their account is disabled; reviewers decide, and the account is restored or stays disabled.
    4. Keep Learning – The system trains new models from reviewers' decisions and challenge results every week and uses them only after they prove at least as good as the current ones.

    Non-Functional Requirements

    1. Scale – 5M sign-ups a day: about 60/s on average, 150/s at peak. 2B active accounts take about 1.2M actions/s on average, 3M/s at peak.
    2. Latency – Sign-up decision under 200 ms at p99.
    3. Freshness – An account's suspicious burst leads to a decision within 5 minutes; a new model every week.
    4. Availability – 99.9%. If our system is down, sign-ups still go through and those accounts are checked once it is back; sign-up never fails because of us.