Below ๐โ๐ฆ ๐ฌ๐ก๐๐ซ๐ข๐ง๐ ๐ ๐๐๐ ๐๐ง๐ญ๐๐ซ๐ฏ๐ข๐๐ฐ ๐๐ฎ๐๐ฌ๐ญ๐ข๐จ๐ง๐ฌ asked in a recent interview for a ๐๐๐ญ๐ ๐๐ง๐๐ฅ๐ฒ๐ฌ๐ญ ๐ซ๐จ๐ฅ๐ ๐๐ญ ๐๐๐ง๐ฉ๐๐๐ญ (๐โ๐ ๐ฒ๐๐๐ซ๐ฌ ๐๐ฑ๐ฉ๐๐ซ๐ข๐๐ง๐๐):-
๐น Q1. Identify Active Subscriptions in a Given Timeframe
Table: subscriptions(subscription_id, activation_date, deactivation_date)
Find all subscription_ids that were active at any point between '2010-01-01' and '2020-12-31'.
(Note: If deactivation_date is NULL, consider it as still active.)
๐น Q2. Group Continuous Membership Records into Start & End Periods
Table: memberships(user_id, plan_id, valid_till)
This table contains monthly records for users.
Group rows into blocks where a user stayed continuously subscribed to the same plan without missing a month, and return:
user_id, plan_id, start_date, end_date for each such block.
๐น Q3. Count Logins Based on User Status & Lookback Window
Tables: users(user_id, is_active, offboarded_on)
logins(login_id, user_id, login_date)
For each user:
โ If is_active = true, count logins in the last 12 months from '2023-12-01'
โ If is_active = false, count logins in the 12 months before offboarded_on
Return: user_id, status, period_start, period_end, login_count
๐น Q4. Match First Interaction Channel with Final Conversion
Tables: touchpoints(user_id, channel, interaction_date)
conversions(user_id, converted_on, is_converted)
Among users who converted, find how many had their first interaction channel same as the one that led to conversion.
Use min & max interaction dates to identify first and last channels. Return the percentage of such users.
๐น Q5. Find Cross-Category Spenders in Last 6 Months
Tables:
purchases(user_id, product_id, purchase_date)
products(product_id, category)
Find users who bought products from at least 3 different categories in the last 6 months.
Return user_id and count of unique categories.
Tap โค๏ธ for more
Post #1940
1.78K
- โค 4