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

Determine Maximum Consecutive Order Days Per User

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in data manipulation and time-series reasoning, focusing on date arithmetic, aggregation, and identification of consecutive-day ordering patterns per user.

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

Determine Maximum Consecutive Order Days Per User

Company: Netflix

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

orders +----+---------+------------+ | id | user_id | order_date | +----+---------+------------+ | 1 | 101 | 2024-01-01 | | 2 | 101 | 2024-01-02 | | 3 | 101 | 2024-01-05 | | 4 | 102 | 2024-01-03 | | 5 | 102 | 2024-01-04 | +----+---------+------------+ ##### Scenario The commerce team wants to know each customer’s best ordering streak for loyalty analysis. ##### Question For every user, return the maximum number of consecutive calendar days on which they placed at least one order. ##### Hints Generate dense date series per user; use gaps-and-islands or window functions.

Quick Answer: This question evaluates proficiency in data manipulation and time-series reasoning, focusing on date arithmetic, aggregation, and identification of consecutive-day ordering patterns per user.

Related Interview Questions

  • Aggregate D1 retention cohorts in SQL - Netflix (Medium)
  • Write SQL for DAU and first-purchase conversion - Netflix (Medium)
  • Write SQL for rolling frequency caps - Netflix (Medium)
  • Transform flat keys into nested dictionary - Netflix (Medium)
  • Analyze Retention Metrics Using SQL and Python - Netflix (Medium)
Netflix logo
Netflix
Jul 12, 2025, 6:59 PM
Data Scientist
Onsite
Data Manipulation (SQL/Python)
53
0

orders

+----+---------+------------+ | id | user_id | order_date | +----+---------+------------+ | 1 | 101 | 2024-01-01 | | 2 | 101 | 2024-01-02 | | 3 | 101 | 2024-01-05 | | 4 | 102 | 2024-01-03 | | 5 | 102 | 2024-01-04 | +----+---------+------------+

Scenario

The commerce team wants to know each customer’s best ordering streak for loyalty analysis.

Question

For every user, return the maximum number of consecutive calendar days on which they placed at least one order.

Hints

Generate dense date series per user; use gaps-and-islands or window functions.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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