Menu
mediumGrab · aggregationBasic

Ad click-through conversion rate, per campaign

Marketing wants to know how well each ad campaign converts a click into real intent. For each campaign, compute the click-through conversion rate: the percentage of users who clicked the ad *and* went on to add an item to their cart.

Return campaign and conversion_rate (a percentage, rounded to 1 decimal place).

Schema

ad_clicks
idINT
user_idINT
campaignTEXT
cart_adds
idINT
user_idINT
campaignTEXT

Basic

The example input, expected output, and walkthrough for this question unlock with a Basic plan.

↑ Read the question

Basic

This is a Basic question

Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.

See Basic plans

RM 25/mo · cancel anytime

The interviewer's next question

Drop the per-campaign breakdown and give one headline number: across all campaigns combined, what fraction of clickers went on to add something to cart? Return a single row, conversion_rate (percentage, 1 decimal).

Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.

See Basic plans

RM 25/mo · cancel anytime

Marketing wants to see the drop-off directly: for each campaign, how many distinct users clicked but never added to cart? Return campaign and non_converters.

Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.

See Basic plans

RM 25/mo · cancel anytime

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.