PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in SQL-based data manipulation and analytical querying, including joins, aggregation, time-window filtering, and proportion calculations for operational metrics.

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

Calculate Distinct High-View Posts and Spam View-Prevalence

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

content_views | user_id | post_id | view_count | view_date | | 101 | 572 | 3 | 2021-11-01 | | 102 | 732 | 5 | 2021-11-02 | | 103 | 153 | 12 | 2021-11-03 | | 104 | 634 | 7 | 2021-11-01 | ​ violating_content | post_id | violation_type | probability_violating | | 572 | Spam | 0.70 | | 732 | Scam | 0.85 | | 153 | Nudity | 0.95 | | 634 | Harassment | 0.50 | ##### Scenario A social platform tracks harmful content and needs SQL reports for ops dashboards. ##### Question Write SQL to return the count of distinct posts that accumulated more than 10 views within the past 7 days (inclusive). Write SQL to calculate the view-prevalence of Spam or Scam posts during the last 30 days (total Spam/Scam views ÷ total views). ##### Hints Derive a rolling window from MAX(view_date); join violating_content; filter violation_type IN ('Spam','Scam'); aggregate as required.

Quick Answer: This question evaluates proficiency in SQL-based data manipulation and analytical querying, including joins, aggregation, time-window filtering, and proportion calculations for operational metrics.

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)