PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in SQL data manipulation—principally joins, aggregations, grouping, filtering, date arithmetic, and safe handling of division—and targets the Data Manipulation (SQL/Python) domain for a Data Scientist role; level of abstraction: practical application.

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

Write SQL for seller and category metrics

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

Assume the following marketplace tables. Table: `listing_interactions` - `buyer_id` STRING - `seller_id` STRING - `product_id` STRING - `interaction_date` DATE - `listing_interactions` INT — number of buyer-seller interactions for that product on that date Table: `dim_all_products` - `product_id` STRING - `category` STRING - `snapshot_date` DATE - `create_date` DATE - `country` STRING Assumptions: - `listing_interactions.product_id` joins to `dim_all_products.product_id`. - Each `product_id` in `dim_all_products` represents one listing/product. - Use all available interaction history unless a question specifies a time filter. - All dates are in UTC. - A product has "multiple interactions" if its total `listing_interactions`, summed across all rows, is greater than 1. - "Created in the last 7 days" means `create_date` is between `current_date - 6 days` and `current_date`, inclusive. Write SQL to answer both questions below: 1. How many sellers have more than 3 distinct products that each have multiple interactions? - Required output: one row with column `sellers_with_gt_3_multi_interaction_products`. 2. Among listings in the US that were created in the last 7 days, what percentage of total listing interactions comes from the `vehicle` category? - Required output: one row with column `vehicle_interaction_pct`. - Define this as: `sum(listing_interactions for US listings created in the last 7 days where category = 'vehicle') / sum(listing_interactions for all US listings created in the last 7 days)`. - Handle divide-by-zero safely if there are no qualifying interactions.

Quick Answer: This question evaluates proficiency in SQL data manipulation—principally joins, aggregations, grouping, filtering, date arithmetic, and safe handling of division—and targets the Data Manipulation (SQL/Python) domain for a Data Scientist role; level of abstraction: practical application.

Last updated: May 7, 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)