Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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 and Week-over-Week Growth
00:00
5 left

DAU and Week-over-Week Growth

MediumSQL · PostgreSQL

Problem

Write a query to find the daily active users (DAU) who traded a specific cryptocurrency pair on Kraken Digital Asset Exchange, and calculate the week-over-week growth rate.

Use completed trades for the BTC/USD pair during January 1 through January 14, 2024. Compare each active date with the same date seven days earlier.

Output

  1. One row per date with completed BTC/USD activity.
  2. Columns: trade_date, dau, prior_week_dau, and wow_growth_pct.
  3. Return NULL for growth when no prior-week value exists, and sort by trade_date ascending.

Schema

trades
ColumnTypeDescription
trade_idPKINTUnique trade identifier
user_idINTKraken user identifier associated with the trade
pair_idINTReference to the traded cryptocurrency pair
trade_timestampTIMESTAMPTimestamp when the trade occurred
trade_statusVARCHAR(20)Trade lifecycle status
trading_pairs
ColumnTypeDescription
pair_idPKINTUnique trading-pair identifier
pair_codeVARCHAR(20)Kraken market code, such as BTC/USD
base_assetVARCHAR(10)Base cryptocurrency
quote_assetVARCHAR(10)Quote currency or cryptocurrency
Tablestradestrading_pairs
Interviewer

Your question is DAU and Week-over-Week Growth. 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.