PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/Meta

Write SQL for seller and vehicle metrics

Last updated: Apr 2, 2026

Quick Overview

This question evaluates proficiency in SQL data manipulation, including joins, distinct counts, grouping and aggregation, filtering by date and category, and computing percentage metrics for marketplace analytics.

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

Write SQL for seller and vehicle metrics

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

You are working with a marketplace dataset. ### Table 1: `listing_interactions` - `buyer_id` BIGINT - `seller_id` BIGINT - `interaction_date` DATE - `product_id` BIGINT - `listing_interactions` INT Each row represents the number of interactions between a buyer and a seller for a given product on a given day. ### Table 2: `dim_all_products` - `product_id` BIGINT - `category` VARCHAR - `snapshot_date` DATE - `create_date` DATE - `country` VARCHAR Assume `product_id` can be used to join the two tables, and for these questions there is one relevant product record per `product_id`. Assume all dates are stored in UTC. For the second question, interpret "created in the last 7 days" as `create_date` between `CURRENT_DATE - INTERVAL '6' DAY` and `CURRENT_DATE`, inclusive. Write SQL for the following: 1. Count how many sellers have **more than 3 distinct products** where the **total number of listing interactions** for that seller-product pair is greater than 1. - Output column: `seller_count` 2. Among products in the **US** that were **created in the last 7 days**, compute the percentage of total listing interactions that come from the `vehicle` category. - Define the metric as: `100 * sum(listing_interactions for eligible vehicle products) / sum(listing_interactions for all eligible products)` - Output column: `vehicle_interaction_pct`

Quick Answer: This question evaluates proficiency in SQL data manipulation, including joins, distinct counts, grouping and aggregation, filtering by date and category, and computing percentage metrics for marketplace analytics.

Related Interview 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)
Meta logo
Meta
Mar 2, 2026, 12:00 AM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
0
0
Loading...

You are working with a marketplace dataset.

Table 1: listing_interactions

  • buyer_id BIGINT
  • seller_id BIGINT
  • interaction_date DATE
  • product_id BIGINT
  • listing_interactions INT

Each row represents the number of interactions between a buyer and a seller for a given product on a given day.

Table 2: dim_all_products

  • product_id BIGINT
  • category VARCHAR
  • snapshot_date DATE
  • create_date DATE
  • country VARCHAR

Assume product_id can be used to join the two tables, and for these questions there is one relevant product record per product_id.

Assume all dates are stored in UTC. For the second question, interpret "created in the last 7 days" as create_date between CURRENT_DATE - INTERVAL '6' DAY and CURRENT_DATE, inclusive.

Write SQL for the following:

  1. Count how many sellers have more than 3 distinct products where the total number of listing interactions for that seller-product pair is greater than 1.
    • Output column: seller_count
  2. Among products in the US that were created in the last 7 days , compute the percentage of total listing interactions that come from the vehicle category.
    • Define the metric as: 100 * sum(listing_interactions for eligible vehicle products) / sum(listing_interactions for all eligible products)
    • Output column: vehicle_interaction_pct

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Meta•More Data Scientist•Meta Data Scientist•Meta Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)
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.