A fully offline, Java-based competitive programming judge that simulates a real contest environment. Built as a college mini-project covering all 10 modules of the CS2016 (Object-Oriented & Design Patterns) syllabus.
Submit Java solutions → Auto-compile → Execute against hidden test cases → Live leaderboard
| Feature | Description |
|---|---|
| 🔐 Auth System | Register / Login with MD5-hashed passwords and role-based access (Admin / Contestant) |
| 📝 Problem Viewer | Browse 5 built-in problems with statements, sample I/O, difficulty badges, and scoring |
| 💻 Code Editor | In-app editor with syntax template, submit button, and real-time verdict display |
| ⚡ Concurrent Judging | 3-thread ExecutorService pool compiles and runs submissions in parallel via ProcessBuilder |
| 🏆 Live Leaderboard | Auto-updating rankings using PriorityQueue + Observer pattern |
| 🛡️ Sandboxed Execution | Time limits enforced per test case; infinite loops are killed automatically |
| 🗄️ SQLite Database | Persistent storage for users, problems, submissions, and leaderboard entries |
| 📦 Serialization | Binary .ser backup of every submission via ObjectOutputStream |
src/
├── model/ # Data classes — User, Problem, Submission, TestCase, Verdict, LeaderboardEntry
├── interfaces/ # Evaluatable, Rankable, LeaderboardObserver
├── exception/ # CompilationException, TimeLimitExceededException, RuntimeErrorException, DatabaseException
├── collections/ # Leaderboard (PriorityQueue + HashMap), SubmissionCache (HashMap)
├── fileio/ # ProblemFileLoader, TestCaseLoader, SubmissionSerializer
├── db/ # DatabaseManager (Singleton), UserDAO, SubmissionDAO, ProblemDAO
├── engine/ # CompileRunner, TestCaseRunner, JudgeEngine, SubmissionQueue
├── judge/ # AbstractJudge, StandardJudge, StrictJudge, JudgeFactory
├── service/ # UserService, SubmissionService, ContestService
├── ui/ # MainApp, LoginScreen, RegisterScreen, ContestDashboard, ProblemScreen, LeaderboardScreen, AdminScreen
└── Main.java # Entry point
| Module | Topic | Implementation |
|---|---|---|
| 1 | OOP Basics | Encapsulation, static members, access modifiers across all model classes |
| 2 | Classes & Objects | Constructor overloading, toString() / equals() / hashCode() overrides |
| 3 | Interfaces & Abstract | Evaluatable, Rankable interfaces; AbstractJudge with Template Method pattern |
| 4 | Exception Handling | 4 custom exceptions (checked + unchecked), try-with-resources throughout |
| 5 | Collections | PriorityQueue, HashMap, ArrayList, LinkedBlockingQueue, Generics |
| 6 | File I/O | BufferedReader (char streams), FileInputStream (byte streams), ObjectOutputStream (serialization) |
| 7 | Multithreading | ExecutorService, ProcessBuilder, Future, Producer-Consumer with LinkedBlockingQueue |
| 8 | GUI (Swing) | 7 screens with JTable, JSplitPane, JList, GridBagLayout, ActionListener |
| 9 | Design Patterns | Singleton (DatabaseManager), Factory (JudgeFactory), Observer (LeaderboardObserver) |
| 10 | Integration | End-to-end: GUI → Service → Engine → DB, with live leaderboard updates |
- Java JDK 8 (
javaandjavacmust be accessible) - No frameworks or build tools needed — uses plain
javac/java
git clone https://github.com/prathamb9/OODP_Mini_Project.git
cd OODP_Mini_Project# Windows (CMD)
dir /s /b src\*.java > sources.txt
javac -cp "lib\sqlite-jdbc-3.45.1.0.jar;lib\slf4j-api-2.0.9.jar;lib\slf4j-simple-2.0.9.jar" -d out @sources.txt
del sources.txtjava -cp "out;lib\sqlite-jdbc-3.45.1.0.jar;lib\slf4j-api-2.0.9.jar;lib\slf4j-simple-2.0.9.jar" Main| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| # | Title | Difficulty | Max Score |
|---|---|---|---|
| P1 | Hello World | Easy | 100 |
| P2 | Sum of Two Numbers | Easy | 100 |
| P3 | Fibonacci Number | Easy | 100 |
| P4 | Prime Check | Medium | 150 |
| P5 | Palindrome String | Medium | 150 |
| Component | Technology |
|---|---|
| Language | Java 8 |
| GUI | Java Swing |
| Database | SQLite (via JDBC) |
| Build | Plain javac / java |
| Concurrency | ExecutorService, ProcessBuilder |
| Member | Part | Scope |
|---|---|---|
| Member 1 | Foundation Layer | Models, Interfaces, Exceptions, Collections, File I/O, Database (Modules 1–6) |
| Member 2 | Judge Engine | CompileRunner, TestCaseRunner, JudgeEngine, AbstractJudge, Factory Pattern (Modules 3, 7, 9) |
| Member 3 | GUI & Integration | Swing screens, Service layer, Observer pattern, Main entry point (Modules 8–10) |
This project is licensed under the MIT License — see the LICENSE file for details.