Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

First Feature Interaction After Signup

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is First Feature Interaction After Signup. Start with the requirements and the two tables on the right.

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.

Problem

NovaApp wants to understand which product feature each user touches first after creating an account. Write a SQL query to return the first feature interaction that happened on or after each user's signup timestamp.

Requirements

  1. Return one row per user who has at least one valid interaction after signup.
  2. Include user_id, email, signup_at, feature_name, and first_interaction_at.
  3. Ignore events that occurred before signup.
  4. If a user has multiple valid events at the exact same timestamp, return the one with the smaller event_id.
  5. Order the final result by user_id.

Schema

users
ColumnTypeDescription
user_idPKINTUnique identifier for a user
emailVARCHAR(255)User email address
signup_atTIMESTAMPTimestamp when the user signed up
plan_tierVARCHAR(50)Subscription plan tier
feature_events
ColumnTypeDescription
event_idPKINTUnique identifier for an event
user_idINTUser who generated the event
feature_nameVARCHAR(100)Name of the feature the user interacted with
event_atTIMESTAMPTimestamp of the feature interaction
device_typeVARCHAR(50)Device type used for the interaction
Tablesusersfeature_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results