Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Upgrades Without Feature Adoption
00:00
5 left

Upgrades Without Feature Adoption

MediumSQL · PostgreSQL

Problem

How would you structure a SQL query to identify customers who have upgraded their subscription tiers but have not adopted key product features on HubSpot?

Assume an upgrade is a move to a higher tier, and feature adoption is evaluated after the customer's most recent upgrade. Key features are identified in the feature catalog.

Output

  1. One row per qualifying customer with customer_id, customer_name, previous_tier, new_tier, upgrade_date, missing_key_feature_count, and missing_key_features.
  2. Include only customers whose most recent upgrade is followed by no adoption of any key feature.
  3. Order by upgrade_date descending, then customer_id ascending.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique HubSpot customer identifier
customer_nameVARCHAR(100)Customer name
subscription_events
ColumnTypeDescription
event_idPKINTUnique subscription event identifier
customer_idINTCustomer associated with the event
tierVARCHAR(30)Subscription tier after the event
effective_dateDATEDate the tier became effective
feature_catalog
ColumnTypeDescription
feature_idPKINTUnique product feature identifier
feature_nameVARCHAR(100)Product feature name
is_key_featureBOOLEANWhether the feature is considered key for adoption analysis
feature_usage
ColumnTypeDescription
usage_idPKINTUnique feature usage record
customer_idINTCustomer using the feature
feature_idINTFeature used by the customer
used_atDATEDate of feature usage
Tablescustomerssubscription_eventsfeature_catalogfeature_usage
Interviewer

Your question is Upgrades Without Feature Adoption. Start with the requirements and the four 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.