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 Categories by DAU SQL
00:00
5 left

Top Categories by DAU SQL

MediumSQL · PostgreSQL

Problem

Given a dataset of customer interactions, write a SQL query to identify the top-performing product categories by daily active users at Zulily.

Count distinct non-null customers for each calendar date and product category. Return every category tied for the highest daily active user count.

Output

  1. One row per date and top-performing category, with columns event_date, category_name, daily_active_users, and category_rank.
  2. Include only categories with the maximum daily count for that date, ordered by event_date ascending and category_name ascending.

Schema

customer_interactions
ColumnTypeDescription
interaction_idPKINTUnique interaction identifier
customer_idINTCustomer who performed the interaction
product_idINTProduct associated with the interaction
interaction_atTIMESTAMPTimestamp when the interaction occurred
interaction_typeVARCHAR(30)Type of customer interaction
products
ColumnTypeDescription
product_idPKINTUnique product identifier
product_nameVARCHAR(100)Product display name
category_idINTProduct category identifier
product_categories
ColumnTypeDescription
category_idPKINTUnique category identifier
category_nameVARCHAR(60)Product category name
Tablescustomer_interactionsproductsproduct_categories
Interviewer

Your question is Top Categories by DAU SQL. 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.