All interview tracks
IntermediateInterview practice · Marketing analyst

Marketing analyst interview: acquisition math

Practise campaign spend, conversion and attribution questions without multiplying rows or losing organic traffic.

5 questions · 39 minutes · Data: Marketing team

Practise each question under time pressure, then explain your assumptions, data grain and edge cases aloud before comparing solutions.

Start interview practice
SQL
01
→ 02
→ 03

Your exercises

01
Spend by channelNew

Return channel and total_spend, rounded to two decimals, for channels with ad spend. Sort by total_spend descending and channel alphabetically.

7 min
02
Leads by channel including organicNew

Return channel and lead_count for all leads, using 'organic' when campaign_id is NULL. Sort by lead_count descending, then channel alphabetically.

8 min
03
Customers acquired by channelNew

Return channel and converted_leads for leads with a non-NULL converted_at date, using 'organic' for leads without a campaign. Sort by converted_leads descending, then channel alphabetically.

8 min
04
Campaigns with zero leadsNew

Return campaign name and budget for campaigns that generated no leads, sorted by name alphabetically.

7 min
05
Campaign click-through rateNew

For campaigns with ad delivery, return campaign name and CTR percentage as ctr_pct, calculated as total clicks divided by total impressions times 100, rounded to two decimals. Sort by ctr_pct descending, then name alphabetically.

9 min
Queries run on sample company data in SQLite. Core SELECT, JOIN and GROUP BY patterns transfer to other SQL engines; functions, dates and types can differ.