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
DAU with Three Tasks in 24 Hours
00:00
5 left

DAU with Three Tasks in 24 Hours

MediumSQL · PostgreSQL

Problem

Write a query to find the daily active users (DAU) who successfully completed at least three automated tasks within a 24-hour window.

Use the users and task_executions tables. Include only successful executions whose task type is automated. Treat a task completed exactly 24 hours earlier as within the window.

Output

  1. One row per qualifying user and calendar date.
  2. Return activity_date, user_id, and completed_tasks_in_24h.
  3. Include only users with at least three qualifying tasks in a 24-hour window.
  4. Order by activity_date ascending, then user_id ascending.

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
display_nameVARCHAR(100)User display name
task_executions
ColumnTypeDescription
execution_idPKINTUnique task execution identifier
user_idINTUser who initiated the execution
task_typeVARCHAR(30)Execution type, such as automated or manual
statusVARCHAR(30)Execution result status
completed_atTIMESTAMPTimestamp when the execution completed
Tablesuserstask_executions
Interviewer

Your question is DAU with Three Tasks in 24 Hours. Start with the requirements and the two 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.