Which ads pay for themselves?
HardPinterestdata qualitynot existsreturn on ad spendntilesizing· 160 XP (40 per question)
Mock interview. You're interviewing for a senior ads analyst job on a visual discovery app. The interviewer says: "Advertisers pay for every click. We want to show them which campaigns earn their money back, and suggest where to move budget."
ad_eventshas one row perimpression,clickorcheckout. Checkout rows carry therevenuethe advertiser made.- Each campaign pays its
cost_per_clickfor every valid click. - Return on ad spend (ROAS) = revenue / spend. A ROAS of 3 means $3 back for every $1 spent.
Question 1: Check the data first
"Before any money maths: a click should always come after the person saw that campaign's ad. List clicks with no impression from the same user and campaign at or before the click time."
Expected output
- Columns
event_id,campaign_id,user_id,event_ts; sorted byevent_id
Example of the shape (made-up values):
| event_id | campaign_id | user_id | event_ts |
|---|---|---|---|
| 1234 | 5 | 99 | 2026-04-02 10:00:00 |
Hints, the later questions and the answer come with Pro.
Question 1 of 4
Write your query here. Ctrl + Enter submits.