KatInterview

Spotting Automated Accounts from a Comment Event Log

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsanomaly-detectionfeature-engineeringthreshold-selection

Last updated

Design behavioral features from a comment log to flag automated accounts, choose a classification cutoff without clean labels, and check that heavy human users are not unfairly caught.

Scenario

You work as a data scientist at a large social platform. Popular public posts are being flooded with low-value comments, and you suspect that a portion of the accounts behind them are automated. You have one event table, comments_log, with these columns:

ColumnMeaning
comment_idUnique ID of the comment
user_idAccount that wrote the comment
post_idPublic post that was commented on
created_atTime the comment was posted
content_lengthNumber of characters in the comment
is_reportedWhether other users flagged the comment

There are no trusted bot/human labels available up front.

What to answer

  1. Features. Propose three distinct behavioral metrics, computed per account from this table, that would help separate automated accounts from people. Explain why each one should differ between the two groups.
  2. Cutoffs. Describe the statistical method you would use to turn those metrics into a rule that labels an account as a bot, given that you lack ground truth.
  3. Fairness check. Explain how you would verify that the system is not wrongly flagging legitimate heavy users such as power users or celebrities.

A strong answer addresses data volume per account, the role of is_reported, and how you would measure errors, not just overall accuracy.

Hints

Hint 1

Think about features that describe the shape of an account's behavior (timing regularity, variety, targeting) rather than how much it posts, since volume is exactly what legitimate heavy users also have.

Hint 2

With no labels, look at feature distributions for a second mode or a clear tail, use robust statistics (median/MAD, percentiles), and require several signals to agree. Then calibrate the cutoff on a stratified sample reviewed by humans, weighing the cost of false positives against false negatives.

Hint 3

For the fairness check, slice false positive rate by segment (activity level, account age, verified status), deliberately oversample high-activity and verified accounts in the review set, use known-good accounts as a negative control, and run in shadow mode before enforcing.