Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Meta Messengers Last 7 Days

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Top Meta Messengers Last 7 Days. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

On Meta messaging surfaces, growth analysts often monitor who is driving recent conversation volume as part of engagement diagnostics alongside AARRR funnel metrics. Write a SQL query to find the top 3 users who sent the most messages in the last 7 days.

Requirements

  1. Use only the messages table.
  2. Count how many messages each sender_user_id sent in the last 7 days.
  3. Return sender_user_id and message_count.
  4. Order results by message_count descending, then sender_user_id ascending.
  5. Return only the top 3 users.

Schema

messages
ColumnTypeDescription
message_idPKINTUnique message identifier
sender_user_idINTUser who sent the message
recipient_user_idINTUser who received the message
sent_atTIMESTAMPTimestamp when the message was sent
message_surfaceVARCHAR(50)Meta product surface where the message was sent
message_textTEXTMessage content
Tablesmessages
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results