← All Python interview questions

Monthly active users from an event log

MediumDates & Time SeriesMicrosoftPhonePe

An event log has one row per session with a user_id and an event_time string. Product wants monthly active users — the count of distinct users per calendar month.

Write a function mau(df) that returns a Series indexed by the month as "YYYY-MM" strings, holding the distinct user count, sorted by month ascending.

Practising alone only goes so far — our live cohorts pair Python and Pandas depth with dashboards, agentic analytics projects and mock interviews.

Explore the program