PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

The question evaluates temporal data manipulation and aggregation competencies in SQL/Python, focusing on ISO week alignment, consecutive-week logic, and the ability to handle tied top results.

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

Find customer with max rentals in consecutive weeks

Company: Meta

Role: Data Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

You are given a table purchases(customer_id INT, purchase_date DATE, rented_copies INT). Consider only dates in calendar year 2024. Define a full week as an ISO week starting Monday and ending Sunday. Identify customers who made at least one purchase in two consecutive full weeks. For each such consecutive-week pair per customer, compute the total rented_copies in the first week of the pair. Return the customer_id(s) with the highest total_rented_copies in that first week, along with the week_start_date (Monday) and total_rented_copies. If there is a tie, return all ties. Write a single SQL query; you may use EXTRACT/DATE_TRUNC or equivalent.

Quick Answer: The question evaluates temporal data manipulation and aggregation competencies in SQL/Python, focusing on ISO week alignment, consecutive-week logic, and the ability to handle tied top results.

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)