PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates a candidate's competency in designing and computing ad-performance KPIs by performing data manipulation, joining event tables, applying time-window filters, and aggregating metrics using SQL or Python.

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

Calculate Ad Performance with Click-Through and Conversion Rates

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

impressions +---------+---------+---------------------+-----------+ | user_id | ad_id | event_time | platform | +---------+---------+---------------------+-----------+ | 101 | 9001 | 2023-07-01 10:00:00 | iOS | | 102 | 9002 | 2023-07-01 10:00:05 | Android | | 101 | 9003 | 2023-07-01 10:00:10 | Web | +---------+---------+---------------------+-----------+ ​ clicks_conversions +---------+---------+---------------------+------------+ | user_id | ad_id | click_time | is_purchase| +---------+---------+---------------------+------------+ | 101 | 9001 | 2023-07-01 10:00:02 | 0 | | 102 | 9002 | 2023-07-01 10:00:06 | 1 | | 103 | 9004 | 2023-07-01 10:00:12 | 0 | +---------+---------+---------------------+------------+ ##### Scenario You are given two tables that log impressions, clicks and conversions for in-app ads. Build a KPI to evaluate ad performance and write the SQL needed to compute it. ##### Question Propose a single metric that captures both click-through and conversion quality. Write a SQL query that joins the two tables and returns the metric by ad_id for the last 7 days. ##### Hints Define join keys and timing windows; consider CTR, CVR or a composite score.

Quick Answer: This question evaluates a candidate's competency in designing and computing ad-performance KPIs by performing data manipulation, joining event tables, applying time-window filters, and aggregating metrics using SQL or Python.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,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)