Skip to content

[Feat] Add a "Practice Coding Questions" Section to the Platform #149

@Krish-3010

Description

@Krish-3010

Add a "Practice Coding Questions" Section to the Platform

Proposed Feature

Creation of a dedicated "Practice" section where users can attempt coding questions to test and improve their programming skills.

Problem it solves

Currently, openCSE provides excellent theoretical documentation and course outlines for CSE subjects, but learners have no way to actively test their understanding of programming concepts directly on the site. This forces them to use external platforms.

What this contribution will add

  1. A new navigation item (e.g., "Practice" or "Coding Problems") in the header or below the subject cards.

  2. A database / file structure containing beginner-to-intermediate level coding questions relevant to the languages taught (C, Java, Python), including topics like:

    • Arrays and Strings
    • Recursion
    • OOP basics
    • Data Structures (Stacks, Queues, Linked Lists)
  3. An interactive UI where users can:

    • View a problem statement, input/output format, and examples
    • Write/select code with syntax highlighting
    • Compare their solution with a provided model answer or run simple test cases
  4. Organization by topic and difficulty (Easy, Medium, Hard), ideally mapped to semesters/courses (e.g., "Practice C Problems for Semester-1").

Why this is valuable

This transforms openCSE from a passive documentation hub into an active learning platform, giving CSE students hands-on coding practice without leaving the site. This directly supports the project's goal of being "beginner-friendly" and "open."

Potential implementation approach

  • Add a new folder /practice with Markdown or JSON files for questions
  • Create a new React component/page (the site appears to use Next.js/React based on Vercel deployment)
  • Add routing to /practice endpoint
  • Include 5-10 sample questions as a starting point

Sample question structure (JSON example)

{
  "id": 1,
  "title": "Reverse a String",
  "difficulty": "Easy",
  "language": ["C", "Java", "Python"],
  "semester": 1,
  "topic": "Strings",
  "problem_statement": "Write a function that takes a string and returns its reverse.",
  "input_format": "A single line containing a string S",
  "output_format": "The reversed string",
  "example_input": "hello",
  "example_output": "olleh",
  "model_solution": {
    "python": "def reverse_string(s):\n    return s[::-1]",
    "c": "void reverse_string(char str[]) {\n    int len = strlen(str);\n    for(int i = 0; i < len/2; i++) {\n        char temp = str[i];\n        str[i] = str[len-i-1];\n        str[len-i-1] = temp;\n    }\n}",
    "java": "public static String reverseString(String s) {\n    return new StringBuilder(s).reverse().toString();\n}"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions