Compute Daily DAU to MAU Stickiness for Each Alexa Skill

Last updated: November 29, 2026

Quick Overview

From Alexa skill invocation logs, compute for every skill and every day in October the daily active users, the trailing 30-day active users, and their ratio.

Amazon
Data Manipulation (SQL/Python)
Data Scientist
Amazon
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


From Alexa skill invocation logs, compute for every skill and every day in October the daily active users, the trailing 30-day active users, and their ratio.

An engagement metric question in the style of Alexa and Devices analytics, where stickiness separates skills people use habitually from novelty skills. The interviewer checks that you know COUNT DISTINCT cannot be used in a sliding window frame and can build the trailing distinct count with a range join.

What the Interviewer Expects
  • Deduplicate to one row per skill, user and day first
  • Explain why COUNT(DISTINCT) over a sliding window is not supported and what to do instead
  • Build the trailing 30-day window with a range join against a date spine
  • Load 29 days of history before the reporting window
  • Handle days where a skill has MAU but zero DAU
Key Topics to Cover
DAU/MAU
distinct counts
range join
date spine
engagement
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you make this cheaper at Alexa scale with HyperLogLog sketches?
  • How would you compute weekly active users the same way?
  • How would you flag skills whose stickiness dropped sharply week over week?
  • Why can averaging daily ratios across skills mislead?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Table skill_invocations(user_id, skill_id, invoked_ts) with one row per invocation, plus dim_date(cal_date). MAU here means distinct users in the 30 days ending on that day, inclusive. Time zone i...

Approach
  1. daily_users: distinct (skill_id, user_id, day) from September 2 onward so October 1 has a full 30-day lookback.
  2. dau: count per skill and day.
  3. mau: join a date spine of October days to...

Submit Your Answer
Markdown supported