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
Rank Members by Logging Frequency
00:00
5 left

Rank Members by Logging Frequency

MediumSQL · PostgreSQL

Problem

Write a query using window functions to rank Omada Health members by their total weight-loss logging frequency within their first month.

Use the member enrollment date to define the first month. Include members with no qualifying logs, exclude members without an enrollment date, and count only logs recorded from enrollment through the end of the following one-month period.

Output

  1. One row per eligible member with member_id, member_name, log_count, and frequency_rank
  2. Ties share the same rank
  3. Order by frequency_rank ascending, then member_id ascending

Schema

members
ColumnTypeDescription
member_idPKINTUnique Omada Health member identifier
member_nameVARCHAR(100)Member display name
enrollment_dateDATEDate the member enrolled with Omada Health
weight_logs
ColumnTypeDescription
log_idPKINTUnique weight logging event identifier
member_idINTMember associated with the weight log
logged_atTIMESTAMPTimestamp when the weight was logged
Tablesmembersweight_logs
Interviewer

Your question is Rank Members by Logging Frequency. 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.