Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Top Chatters Message Frequency
00:00
5 left

Top Chatters Message Frequency

MediumSQL · PostgreSQL

Problem

Twitch wants to identify the most active chatters in each channel during the first week of August 2026. Write a PostgreSQL query using Twitch channel and chat event data to rank registered chatters by message frequency.

Requirements

  1. Include only message events from August 1 through August 7, 2026, inclusive.
  2. Return the top two registered chatters per Twitch channel, ranked by message count descending.
  3. Include each chatter's message count and percentage of all qualifying messages in that channel.
  4. Break ties deterministically by username and user ID, and order the final results by channel name and rank.

Schema

channels
ColumnTypeDescription
channel_idPKINTTwitch channel identifier
channel_nameVARCHAR(100)Channel display name
users
ColumnTypeDescription
user_idPKINTRegistered Twitch user identifier
usernameVARCHAR(50)Twitch username
chat_events
ColumnTypeDescription
event_idPKINTChat event identifier
channel_idINTReferenced Twitch channel
user_idINTUser who generated the event
event_typeVARCHAR(30)Event category
event_timeTIMESTAMPTime at which the event occurred
Tableschannelsuserschat_events
Interviewer

Your question is Top Chatters Message Frequency. Start with the requirements and the three tables in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.