PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Pinduoduo

Compute User Login Streaks

Last updated: May 12, 2026

Quick Overview

This question evaluates SQL proficiency in processing event logs for time-series analysis, encompassing date arithmetic, deduplication of same-day events, consecutive-date streak detection, and result-schema design within the Data Engineering and Coding & Algorithms domain.

  • easy
  • Pinduoduo
  • Coding & Algorithms
  • Data Engineer

Compute User Login Streaks

Company: Pinduoduo

Role: Data Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Given a table `user_login_log` with the following columns: - `user_id`: the user identifier - `login_date`: the calendar date of a login event A user may have multiple login events on the same date; treat multiple logins by the same user on the same date as one login day. A login streak is a sequence of consecutive calendar dates on which the user logged in at least once. Write SQL queries and discuss the final output schemas for the following tasks: 1. For a given 15-day analysis window, compute each user's consecutive login streaks within that window. 2. Compute each user's maximum consecutive login streak length across the available data. 3. Return the users who have at least one login streak of two or more consecutive days.

Quick Answer: This question evaluates SQL proficiency in processing event logs for time-series analysis, encompassing date arithmetic, deduplication of same-day events, consecutive-date streak detection, and result-schema design within the Data Engineering and Coding & Algorithms domain.

Related Interview Questions

  • Find Shortest Square-Sum Path - Pinduoduo (hard)
  • Determine Straight Flush - Pinduoduo (easy)
  • Design a Recency-Eviction Cache - Pinduoduo (medium)
  • Find missing rank in a straight - Pinduoduo (easy)
  • Find next greater element for subset - Pinduoduo (easy)
Pinduoduo logo
Pinduoduo
Apr 3, 2026, 12:00 AM
Data Engineer
Technical Screen
Coding & Algorithms
4
0
Loading...

Given a table user_login_log with the following columns:

  • user_id : the user identifier
  • login_date : the calendar date of a login event

A user may have multiple login events on the same date; treat multiple logins by the same user on the same date as one login day. A login streak is a sequence of consecutive calendar dates on which the user logged in at least once.

Write SQL queries and discuss the final output schemas for the following tasks:

  1. For a given 15-day analysis window, compute each user's consecutive login streaks within that window.
  2. Compute each user's maximum consecutive login streak length across the available data.
  3. Return the users who have at least one login streak of two or more consecutive days.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Pinduoduo•More Data Engineer•Pinduoduo Data Engineer•Pinduoduo Coding & Algorithms•Data Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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.