CS5004 Object-Oriented Design - Final Project Fall 2025 Northeastern University
- Mohammad Ali Shehral - shehral.m@northeastern.edu
- Hao Wang (Alan) - wang.h5@northeastern.edu
- Yujing Wang - wang.yujing@northeastern.edu
InterviewForum is a Java-based desktop application designed to help software engineering students prepare for technical interviews. The platform provides a focused discussion forum for three key interview topics: LeetCode algorithm problems, System Design questions, and Behavioral interview preparation.
As graduate students preparing for software engineering interviews, we identified a need for a focused, organized platform to discuss interview-specific topics. While general forums like Reddit exist, they lack the structure and immediacy needed for effective interview preparation. InterviewForum solves this by providing:
- Topic-specific categorization (LeetCode, System Design, Behavioral)
- Threaded discussions with replies
- Keyword search functionality
- Persistent data storage
- Clean, distraction-free interface
- Post Creation - Create discussion posts with title, content, and topic tags
- Reply System - Add threaded replies to existing posts
- Topic Filtering - Filter posts by LeetCode, System Design, or Behavioral categories
- Keyword Search - Search posts by keywords in title or content
- Sorting - Sort posts by date, reply count, or topic
- Data Persistence - Automatic save/load to file system
- Clean JFrame-based GUI with Swing components
- Color-coded topic tags for visual organization
- Real-time input validation with character counts
- Keyboard shortcuts for common actions
- Responsive layout with scrollable content
The application follows a strict Model-View-Controller architecture:
┌─────────────────────────────────────────────────────────┐
│ VIEW │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ MainView │ │CreatePostView│ │ViewThreadView│ │
│ │ (JFrame) │ │ (JDialog) │ │ (JDialog) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────┘
▲
│ Updates UI
│
┌─────────────────────────────────────────────────────────┐
│ CONTROLLER │
│ ┌──────────────────────┐ │
│ │ ForumController │ │
│ │ - handleCreatePost()│ │
│ │ - handleReply() │ │
│ │ - handleFilter() │ │
│ │ - handleSearch() │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────────────────┘
▲
│ Calls methods
│
┌─────────────────────────────────────────────────────────┐
│ MODEL │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ ForumModel │ │ Post │ │ Reply │ │
│ │ (Singleton) │ │ (Entity) │ │ (extends │ │
│ │ │ │ │ │ Post) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────────────────────┐ │
│ │FileManager │ │ Sort Strategies (Strategy │ │
│ │(Persistence) │ │ Pattern) │ │
│ └──────────────┘ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
-
MVC (Model-View-Controller) - Primary architectural pattern
- Clear separation of concerns
- Model independent of View
- Controller mediates user interactions
-
Singleton Pattern - ForumModel instance management
- Ensures single source of truth for forum data
- Prevents data inconsistencies
-
Strategy Pattern - Sorting algorithms
- Pluggable sorting strategies (by date, replies, topic)
- Easy to extend with new sorting methods
-
Inheritance - Reply extends Post
- Code reuse for common fields and methods
- Liskov Substitution Principle applied
-
Composition - Post contains List
- Flexible post-reply relationship
- Demonstrates "has-a" relationship
Single Responsibility Principle
- Each class has one clear purpose
- Post manages post data only
- FileManager handles only file I/O
- ForumController coordinates only user actions
Open/Closed Principle
- Can add new Topic enum values without modifying Post class
- Can add new SortStrategy implementations without changing ForumModel
- Extensible for future features (upvoting, user authentication)
Liskov Substitution Principle
- Reply objects can substitute Post objects in collections
- Different SortStrategy implementations are interchangeable
- Maintains behavioral consistency
Interface Segregation Principle
- IForumModel exposes only necessary methods
- ISortStrategy defines minimal contract
- Views don't depend on unused model methods
Dependency Inversion Principle
- Controller depends on IForumModel interface, not concrete ForumModel
- Enables testing with mock implementations
- Higher-level modules don't depend on lower-level details
Our implementation demonstrates 20+ OOD design rules from CS5004:
- Encapsulation - Private fields with public getters
- Input Validation - All user inputs validated before processing
- Exception Handling - Try-catch blocks for file I/O operations
- Proper Constructors - Validation in constructors
- Immutability - Final fields where appropriate
- Access Modifiers - Proper use of public, private, protected
- Method Naming - Verbs for actions (createPost, addReply)
- Class Naming - Nouns for entities (Post, Reply, ForumModel)
- Comprehensive Javadocs - All public methods documented
- Inline Comments - Design decisions explained
- DRY Principle - No repeated code
- Proper Collections - ArrayList, HashMap used appropriately
- Defensive Copying - getReplies() returns new list
- equals() and hashCode() - Properly implemented
- toString() - Useful for debugging
- Separation of Concerns - MVC separation
- Testable Code - Methods designed for unit testing
- Enums for Constants - Topic enum instead of magic strings
- Resource Management - Proper file closing with try-with-resources
- User-Friendly Error Messages - Clear error dialogs
- Null Checks - Prevent NullPointerExceptions
- Constants for Magic Numbers - MAX_TITLE_LENGTH, MAX_CONTENT_LENGTH
- Total Lines of Code: 3,363+ lines
- Source Code: 2,143 lines (17 files)
- Test Code: 1,220 lines (6 test files)
- Number of Classes: 17 source classes
- Number of Interfaces: 2 interfaces
- Number of Enums: 1 enum (Topic)
- Test Coverage: 114 comprehensive tests
- Unit Tests: 80 tests (PostTest: 26, ReplyTest: 17, ForumModelTest: 28, FileManagerTest: 12, Topic: 7)
- Controller Tests: 20 tests (ForumControllerTest)
- Integration Tests: 11 tests (IntegrationTest)
- All tests include 2-3 assertions each
- Edge cases, boundary values, and error conditions covered
- Design Patterns: 5 patterns implemented
- OOD Principles: 22+ principles demonstrated
- Java 17 or higher
- JUnit 5 (for running tests)
- IntelliJ IDEA (recommended) or any Java IDE
-
Open Project
File → Open → Select "Final Project" folder -
Verify Configuration
- Ensure
srcfolder is marked as Sources Root - Ensure
testfolder is marked as Test Sources Root - These should be configured automatically via
5004.iml
- Ensure
-
Run Application
Right-click on InterviewForumApp.java → Run 'InterviewForumApp.main()' -
Run Tests
# Run all tests Right-click on test folder → Run 'All Tests' # Or run specific test suites Right-click on test/model → Run 'Tests in model' Right-click on test/controller → Run 'Tests in controller' Right-click on test/integration → Run 'Tests in integration'
cd "Final Project"
javac -d out src/model/*.java src/model/sort/*.java \
src/controller/*.java src/view/*.java src/*.javajava -cp out InterviewForumAppjavac -d out -cp "out:junit-platform-console-standalone.jar" test/model/*.javajava -jar junit-platform-console-standalone.jar --class-path out --scan-class-path- Launch the application
- Click the "New Post" button (blue)
- Fill in:
- Title (max 100 characters)
- Topic (LeetCode, System Design, or Behavioral)
- Content (max 5000 characters)
- Click "Submit" (button enabled when all fields are valid)
- Double-click on any post in the main list
- The thread view opens showing the full post and existing replies
- Scroll to the bottom
- Type your reply in the text area (max 2000 characters)
- Click "Submit Reply" (green button)
- Use the "Filter by Topic" dropdown at the top
- Select: All Topics, LeetCode, System Design, or Behavioral
- Post list updates instantly
- Enter keywords in the search box
- Press Enter or click "Search"
- Searches both titles and content (case-insensitive)
- Use the "Sort by" dropdown
- Options: Newest First, Most Replies, By Topic
- All posts and replies are automatically saved to
forum_data.txt - Data is loaded automatically when the application starts
- Location: Same directory where you run the application
Final Project/
├── src/
│ ├── model/
│ │ ├── Topic.java (49 lines)
│ │ ├── Post.java (254 lines)
│ │ ├── Reply.java (121 lines)
│ │ ├── IForumModel.java (108 lines)
│ │ ├── ForumModel.java (195 lines)
│ │ ├── FileManager.java (138 lines)
│ │ └── sort/
│ │ ├── ISortStrategy.java (27 lines)
│ │ ├── SortByDateStrategy.java (29 lines)
│ │ ├── SortByRepliesStrategy.java (29 lines)
│ │ └── SortByTopicStrategy.java (29 lines)
│ ├── controller/
│ │ └── ForumController.java (190 lines)
│ ├── view/
│ │ ├── MainView.java (346 lines)
│ │ ├── CreatePostView.java (235 lines)
│ │ └── ViewThreadView.java (308 lines)
│ └── InterviewForumApp.java (46 lines)
├── test/
│ └── model/
│ ├── PostTest.java (144 lines)
│ ├── ReplyTest.java (95 lines)
│ ├── ForumModelTest.java (171 lines)
│ └── FileManagerTest.java (111 lines)
├── out/ (compiled .class files - not committed)
├── forum_data.txt (auto-generated data file)
├── README.md (this file)
We have comprehensive JUnit 5 test coverage:
PostTest.java (26 test methods)
- Post creation validation
- Input edge cases (empty, null, too long)
- Reply management
- File serialization/deserialization
ReplyTest.java (17 test methods)
- Reply creation and validation
- Parent-child relationship
- Inheritance behavior
ForumModelTest.java (28 test methods)
- Singleton pattern verification
- CRUD operations
- Filtering and searching
- Sorting algorithms
FileManagerTest.java (12 test methods)
- Save and load operations
- Data persistence across sessions
- Error handling (corrupted files, missing files)
ForumControllerTest.java (20 test methods)
- Controller operations and error handling
- Model interaction validation
- User action handling
IntegrationTest.java (11 test methods)
- End-to-end workflow testing
- Complete user scenarios
All tests pass with 100% success rate. To verify:
Right-click on test folder → Run 'All Tests'Expected output: 114 tests passed ✓
- No User Authentication - Posts are anonymous
- File-Based Storage - Not suitable for high-volume concurrent users
- No Nested Replies - Replies cannot have replies (MVP scope)
- Plain Text Only - No code syntax highlighting or rich formatting
- Single Instance - No multi-user support or real-time updates
- Desktop Only - No web or mobile interface
- User Authentication - Login system with profiles
- Database Integration - PostgreSQL for scalability
- Upvote/Downvote - Community-driven content ranking
- Code Highlighting - Syntax highlighting for code snippets
- Rich Text Editor - Markdown support
- Direct Messaging - Private conversations between users
- Email Notifications - Alerts for replies to your posts
- REST API - Backend API for web/mobile clients
- Web Frontend - React.js web application
- Mobile App - iOS and Android applications
- LeetMate Integration - Connect with existing LeetCode study platform
- AI-Powered Suggestions - Recommend related posts
- Video/Image Attachments - Multimedia support
- Oracle Java SE Documentation: https://docs.oracle.com/en/java/javase/17/
- Java Swing Tutorial: https://docs.oracle.com/javase/tutorial/uiswing/
- Refactoring Guru: https://refactoring.guru/design-patterns
- JUnit 5 User Guide: https://junit.org/junit5/docs/current/user-guide/
- Google Java Style Guide: https://google.github.io/styleguide/javaguide.html
- CS5004 Modules 8-10 (MVC Architecture)
- CS5004 Modules 12-14 (Design Patterns)
- Lab 8 (Mock Model Testing)
- Lab 9 (MVC with I/O Abstraction)
Our final presentation (Dec 11, 2025) will cover:
- Goals & Rationale - Why this project matters
- Live Demo - Creating posts, adding replies, filtering, searching
- Technical Architecture - MVC, design patterns, SOLID principles
- Code Walkthrough - Deep dive into one key component
- Lessons Learned - Challenges and solutions
- Q&A - Open discussion
Presentation duration: 12-15 minutes
All team members contributed approximately equally:
- Mohammad Ali Shehral: 30%
- Hao Wang (Alan): 30%
- Yujing Wang: 30%
- AI Tools (Claude / Codex / Gemini): 10%
This is an academic project for CS5004 - Object-Oriented Design, Fall 2025. Northeastern University
Contact Information
- Project Repository: https://github.com/shehral/InterviewForum
- Course: CS5004 - Object-Oriented Design
- Instructor: Prof. Mark L. Miller
- Semester: Fall 2025