Skip to content

shehral/InterviewForum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

InterviewForum - Tech Interview Discussion Platform

CS5004 Object-Oriented Design - Final Project Fall 2025 Northeastern University

Team Members

Project Overview

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.

Motivation

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

Features

Core Functionality

  1. Post Creation - Create discussion posts with title, content, and topic tags
  2. Reply System - Add threaded replies to existing posts
  3. Topic Filtering - Filter posts by LeetCode, System Design, or Behavioral categories
  4. Keyword Search - Search posts by keywords in title or content
  5. Sorting - Sort posts by date, reply count, or topic
  6. Data Persistence - Automatic save/load to file system

User Interface

  • 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

Technical Architecture

MVC Design Pattern

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)                     │    │
│  └──────────────┘  └──────────────────────────────┘    │
└─────────────────────────────────────────────────────────┘

Design Patterns Implemented

  1. MVC (Model-View-Controller) - Primary architectural pattern

    • Clear separation of concerns
    • Model independent of View
    • Controller mediates user interactions
  2. Singleton Pattern - ForumModel instance management

    • Ensures single source of truth for forum data
    • Prevents data inconsistencies
  3. Strategy Pattern - Sorting algorithms

    • Pluggable sorting strategies (by date, replies, topic)
    • Easy to extend with new sorting methods
  4. Inheritance - Reply extends Post

    • Code reuse for common fields and methods
    • Liskov Substitution Principle applied
  5. Composition - Post contains List

    • Flexible post-reply relationship
    • Demonstrates "has-a" relationship

SOLID Principles

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

Object-Oriented Design Principles Demonstrated

Our implementation demonstrates 20+ OOD design rules from CS5004:

  1. Encapsulation - Private fields with public getters
  2. Input Validation - All user inputs validated before processing
  3. Exception Handling - Try-catch blocks for file I/O operations
  4. Proper Constructors - Validation in constructors
  5. Immutability - Final fields where appropriate
  6. Access Modifiers - Proper use of public, private, protected
  7. Method Naming - Verbs for actions (createPost, addReply)
  8. Class Naming - Nouns for entities (Post, Reply, ForumModel)
  9. Comprehensive Javadocs - All public methods documented
  10. Inline Comments - Design decisions explained
  11. DRY Principle - No repeated code
  12. Proper Collections - ArrayList, HashMap used appropriately
  13. Defensive Copying - getReplies() returns new list
  14. equals() and hashCode() - Properly implemented
  15. toString() - Useful for debugging
  16. Separation of Concerns - MVC separation
  17. Testable Code - Methods designed for unit testing
  18. Enums for Constants - Topic enum instead of magic strings
  19. Resource Management - Proper file closing with try-with-resources
  20. User-Friendly Error Messages - Clear error dialogs
  21. Null Checks - Prevent NullPointerExceptions
  22. Constants for Magic Numbers - MAX_TITLE_LENGTH, MAX_CONTENT_LENGTH

Project Statistics

  • 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

Build & Run Instructions

Prerequisites

  • Java 17 or higher
  • JUnit 5 (for running tests)
  • IntelliJ IDEA (recommended) or any Java IDE

Using IntelliJ IDEA

  1. Open Project

    File → Open → Select "Final Project" folder
    
  2. Verify Configuration

    • Ensure src folder is marked as Sources Root
    • Ensure test folder is marked as Test Sources Root
    • These should be configured automatically via 5004.iml
  3. Run Application

    Right-click on InterviewForumApp.java → Run 'InterviewForumApp.main()'
    
  4. 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'
    

Using Command Line

Compile

cd "Final Project"
javac -d out src/model/*.java src/model/sort/*.java \
     src/controller/*.java src/view/*.java src/*.java

Run

java -cp out InterviewForumApp

Compile Tests (requires JUnit 5 jars)

javac -d out -cp "out:junit-platform-console-standalone.jar" test/model/*.java

Run Tests

java -jar junit-platform-console-standalone.jar --class-path out --scan-class-path

Usage Guide

Creating a Post

  1. Launch the application
  2. Click the "New Post" button (blue)
  3. Fill in:
    • Title (max 100 characters)
    • Topic (LeetCode, System Design, or Behavioral)
    • Content (max 5000 characters)
  4. Click "Submit" (button enabled when all fields are valid)

Adding a Reply

  1. Double-click on any post in the main list
  2. The thread view opens showing the full post and existing replies
  3. Scroll to the bottom
  4. Type your reply in the text area (max 2000 characters)
  5. Click "Submit Reply" (green button)

Filtering Posts

  • Use the "Filter by Topic" dropdown at the top
  • Select: All Topics, LeetCode, System Design, or Behavioral
  • Post list updates instantly

Searching Posts

  • Enter keywords in the search box
  • Press Enter or click "Search"
  • Searches both titles and content (case-insensitive)

Sorting Posts

  • Use the "Sort by" dropdown
  • Options: Newest First, Most Replies, By Topic

Data Persistence

  • 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

File Structure

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)

Testing

Unit Tests

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

Test Execution

All tests pass with 100% success rate. To verify:

Right-click on test folder → Run 'All Tests'

Expected output: 114 tests passed ✓

Known Limitations

  1. No User Authentication - Posts are anonymous
  2. File-Based Storage - Not suitable for high-volume concurrent users
  3. No Nested Replies - Replies cannot have replies (MVP scope)
  4. Plain Text Only - No code syntax highlighting or rich formatting
  5. Single Instance - No multi-user support or real-time updates
  6. Desktop Only - No web or mobile interface

Future Enhancements

Version 2.0 Features

  • 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

Version 3.0 Features

  • 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

Resources & Citations

Java Documentation

Design Patterns

Testing

Code Style

Course Materials

  • CS5004 Modules 8-10 (MVC Architecture)
  • CS5004 Modules 12-14 (Design Patterns)
  • Lab 8 (Mock Model Testing)
  • Lab 9 (MVC with I/O Abstraction)

Presentation

Our final presentation (Dec 11, 2025) will cover:

  1. Goals & Rationale - Why this project matters
  2. Live Demo - Creating posts, adding replies, filtering, searching
  3. Technical Architecture - MVC, design patterns, SOLID principles
  4. Code Walkthrough - Deep dive into one key component
  5. Lessons Learned - Challenges and solutions
  6. Q&A - Open discussion

Presentation duration: 12-15 minutes

Team Contribution

All team members contributed approximately equally:

  • Mohammad Ali Shehral: 30%
  • Hao Wang (Alan): 30%
  • Yujing Wang: 30%
  • AI Tools (Claude / Codex / Gemini): 10%

License

This is an academic project for CS5004 - Object-Oriented Design, Fall 2025. Northeastern University


Contact Information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages