-
Notifications
You must be signed in to change notification settings - Fork 1
Data Model
dagustin415 edited this page Feb 5, 2026
·
4 revisions
24 supported languages:
javascript | typescript | python | java | cpp | csharp | go | ruby | c | php |
kotlin | rust | swift | scala | r | perl | lua | haskell | elixir | dart |
clojure | postgresql | mysql | mongodb
The universal contract for coding challenges across all 24 languages.
interface Problem {
id: string;
title: string;
description: string;
difficulty: 'easy' | 'medium' | 'hard';
category: string;
solution: string;
hint?: string;
tags?: string[];
testCases?: TestCase[];
validPatterns?: RegExp[]; // For non-JS/TS validation
starterCode?: string;
}Structured algorithm exercises with starter code, solutions, and test cases.
interface Exercise {
id: string;
title: string;
category: ExerciseCategory;
difficulty: ExerciseDifficulty;
description: string;
explanation: string;
instructions: string[];
starterCode: string;
solutionCode: string;
testCases: TestCase[];
hints: string[];
concepts: string[];
}
type ExerciseCategory =
| 'traversal' | 'iteration-patterns' | 'recursion'
| 'combinatorics' | 'searching' | 'data-structures'
| 'memoization' | 'utilities';
type ExerciseDifficulty = 'beginner' | 'intermediate' | 'advanced';interface QuizQuestion {
question: string;
options: string[];
correctAnswer: number;
explanation: string;
category?: string;
difficulty?: string;
}interface Method {
name: string;
description: string;
syntax: string;
returns: string;
example: string;
category: string;
}'native-js' | 'react' | 'angular' | 'vue'
interface FrontendDrillProblem {
id: string;
title: string;
description: string;
difficulty: 'easy' | 'medium' | 'hard';
category: FrontendCategory;
solution: string;
hint?: string;
framework: FrameworkId;
validPatterns?: RegExp[];
}interface FrontendQuizQuestion {
id: string;
question: string;
options: string[];
correctAnswer: number;
explanation: string;
category: string;
difficulty: 'easy' | 'medium' | 'hard';
framework: FrameworkId;
}interface UIPattern {
id: string;
title: string;
category: UIPatternCategory;
difficulty: UIPatternDifficulty;
description: string;
concepts: string[];
framework: FrameworkId;
promptDescription?: string;
externalUrl?: string;
demoCode?: {
html: string;
css: string;
js: string;
};
}
type UIPatternCategory =
| 'forms-input' | 'interactive' | 'data-display'
| 'navigation' | 'advanced' | 'ui-components';interface CheatsheetData {
framework: FrameworkId;
sections: CheatsheetSection[];
}
interface CheatsheetSection {
id: CheatsheetSectionId;
title: string;
icon: string;
content: CheatsheetContentBlock[];
}
// 6 section IDs: overview, core-concepts, key-apis,
// common-patterns, code-examples, ecosystem
// 8 content block types:
type CheatsheetContentBlock =
| { type: 'text'; content: string }
| { type: 'code'; language: string; content: string }
| { type: 'interactive-code'; language: string; content: string }
| { type: 'list'; items: string[] }
| { type: 'table'; headers: string[]; rows: string[][] }
| { type: 'tip'; content: string }
| { type: 'warning'; content: string }
| { type: 'subheading'; content: string };interface UserProgress {
solvedProblems: Record<LanguageId, Set<string>>;
drillStats: DrillStats;
quizStats: QuizStats;
}
interface DrillStats {
totalAttempts: number;
correctAttempts: number;
bestStreak: number;
currentStreak: number;
averageTime: number;
}interface ExecutionResult {
success: boolean;
output: string;
error?: string;
}
interface ValidationResult {
isValid: boolean;
message: string;
antiCheatFlags?: AntiCheatFlag[];
}
interface TestCase {
input: any[];
expected: any;
description?: string;
}