Interview Query

Fraudulent Upvotes

Start Timer

0:00:00

Upvote
13
Downvote
Save question
Mark as completed
View comments (19)
Next question

We are given three tables about a digital community, users, comments, comment_votes, representing a forum of users and their comments on posts.

We want to figure out if bad actor users are creating multiple accounts in order to upvote their own comments.

  1. What kind of metrics could we use to figure this out?

  2. Write a query that could display the percentage of users on our forum that would be acting fraudulently in this manner. 

Example:

Input:

users table

Column Type
id INTEGER
created_at DATETIME
username VARCHAR

comments table

Column Type
id INTEGER
created_at DATETIME
post_id INTEGER
user_id INTEGER

comment_votes table

Column Type
id INTEGER
created_at DATETIME
user_id INTEGER
comment_id INTEGER
is_upvote BOOLEAN

Output:

Column Type
voter_id INTEGER
voter VARCHAR
commenter_id INTEGER
commenter VARCHAR
vote_perc FLOAT
.
.
.
.
.


Comments

Loading comments..