Skip to content

Track Streaks #206

@Kevin-Roman

Description

@Kevin-Roman

Description

LeetCode does not publicly expose users' streak data through its API. However, streak information can still be inferred by analysing a user’s most recent successful submissions. The workaround would include:

  • Approach: Periodically (every 30 minutes, within the scheduled stats updates), retrieve and review the latest 20 successful submissions for each user. 20 is the max number of latest submissions that can be retrieved. Then, check if the daily problem has been completed within these submissions. If the daily problem is completed, update the user’s streak data in the database.
  • Limitations: There is a minor risk of missing the daily challenge detection if a user submits more than 20 solutions in a 30-minute window. Though this is rare and unlikely.
  • User Notifications: If a user has enabled notifications, we could send a ping when their streak updates or when they're planned to miss their streak. Although, how user-specific interactions can be done needs to be explored.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions