Skip to content

Add DSA study-plan scheduler endpoint #2305

Description

@vedant7007

Feature: DSA study-plan scheduler

Users have practice sheets (e.g. Striver SDE) but no way to turn them into a "prep in N days" plan. A balanced, difficulty-aware schedule would let them spread problems across days without overloading any single day.

Proposal

Add POST /api/question/study-plan backed by a pure buildStudyPlan(problems, days):

  • Weights problems by difficulty (easy=1, medium=2, hard=3; unknown→medium) and distributes them across days buckets using difficulty-weighted LPT (longest-processing-time) scheduling so day loads stay balanced.
  • Returns { plan: [{ day, problems, load }], totalLoad, days }.

Pure, deterministic, no new dependency — fully unit-testable with plain objects.

Acceptance criteria

  • Balances load across days (LPT), every problem placed exactly once
  • Handles more days than problems (empty days), missing difficulty → medium
  • Guards invalid input (non-array, non-positive/non-integer days)
  • Pure function covered by vitest unit tests

I'd like to work on this.

Contributing as part of Elite Coders Summer of Code (ECSoC 2026).

Metadata

Metadata

Assignees

Labels

claimedThis issue has been claimed by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions