Skip to content

🐛 Refactor Problem Metadata Schema & Remove Hardcoded Problem Details #51

Description

@kumar-veerendra

Summary

Refactor the problem metadata system by moving hardcoded values from the frontend into the database schema and ensuring each problem has accurate metadata.


Current Behavior

Several problem details are currently hardcoded or use default values instead of being fetched from the database.

Examples:

  • Constraints use the same default value for every problem.
  • Hidden test case count is hardcoded.
  • Hints are hardcoded in the frontend.
  • The problem schema does not support storing hints.
  • The problem schema does not support hidden test case metadata.

As a result, different problems cannot display their own metadata accurately.


Proposed Implementation

Update Problem Schema

Add support for:

  • Constraints
  • Hints
  • Hidden Test Case Count
  • Hidden Test Case Metadata (if required)

Database Migration

Update existing problems with:

  • Correct constraints
  • Problem-specific hints
  • Hidden test case information

Frontend Changes

Remove hardcoded values and fetch metadata directly from the backend.

Replace hardcoded:

  • Constraints
  • Hints
  • Hidden test case count

with dynamic API data.


Current Flow

Open Problem
      │
      ▼
Fetch Problem
      │
      ▼
Frontend injects:
- Default Constraints
- Hardcoded Hints
- Hardcoded Hidden Test Cases

Proposed Flow

Open Problem
      │
      ▼
Fetch Problem
      │
      ▼
Receive Complete Metadata
      │
      ▼
Display:
- Constraints
- Hints
- Hidden Test Cases
- Other Problem Details

Benefits

  • Accurate problem information
  • Easier to manage problems
  • No frontend hardcoding
  • Better scalability
  • Cleaner architecture
  • Easier to add new problems

Acceptance Criteria

  • Problem schema supports constraints.
  • Problem schema supports hints.
  • Problem schema supports hidden test case metadata.
  • Existing problems are migrated.
  • Frontend no longer contains hardcoded values.
  • Problem details are fetched dynamically from the backend.
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions