PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates data manipulation and analytics skills for computing time-windowed ad performance metrics, including aggregations of impressions and revenue, join logic between impression and conversion records, conversion-rate calculation, and ranking.

  • Medium
  • Meta
  • Data Manipulation (SQL/Python)
  • Data Scientist

Rank Ads by Conversion Rate for Top 10 Performers

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

ad id | advertiser_id | created_at 1 | 101 | 2023-07-01 2 | 102 | 2023-07-05 3 | 101 | 2023-07-10 ​ impression id | ad_id | user_id | timestamp 10 | 1 | 555 | 2023-07-11 10:00 11 | 1 | 556 | 2023-07-11 10:05 12 | 2 | 557 | 2023-07-12 09:00 ​ conversion id | impression_id | revenue | timestamp 100 | 10 | 5.00 | 2023-07-11 10:10 101 | 12 | 10.00 | 2023-07-12 09:15 ##### Scenario Advertising platform wants to track ad effectiveness over the last 30 days. ##### Question Given tables ad, impression and conversion, write SQL to return for every ad_id: total impressions, total conversions, conversion_rate and total_revenue for the past 30 days. Extend the query to rank ads by conversion_rate and return the top 10 performers. ##### Hints Think joins (impression → conversion), date filters, group-by ad_id, and safe division for rates.

Quick Answer: This question evaluates data manipulation and analytics skills for computing time-windowed ad performance metrics, including aggregations of impressions and revenue, join logic between impression and conversion records, conversion-rate calculation, and ranking.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Compute ad impression conversion rates - Meta (medium)
  • Count unconnected posts and reactions - Meta (medium)
  • Count heavy callers in 7 days - Meta (medium)
  • Write SQL for call metrics - Meta (medium)
  • Write SQL for multi-account metrics - Meta (medium)