Skip to content

Latest commit

 

History

History
565 lines (479 loc) · 17.1 KB

File metadata and controls

565 lines (479 loc) · 17.1 KB

Interview Replay System - Feature Documentation

🎬 Overview

The Interview Replay System is a powerful new feature that allows users to review their completed interviews with full playback functionality, add personal notes, bookmark important moments, and track their learning progress over time.

🎯 Problem Solved

After completing an interview, candidates often:

  • Forget what questions were asked and how they answered
  • Miss opportunities to learn from their mistakes
  • Can't track improvement patterns over time
  • Lack a structured way to reflect on performance
  • Want to share specific moments with mentors or study buddies

The Replay System solves all these problems by providing a comprehensive review experience.

✨ Key Features

1. Full Interview Playback

  • Access complete conversation history with AI interviewer
  • View questions, answers, and AI feedback in chronological order
  • See performance scores and evaluations for each question
  • Resume from last viewed position

2. Timestamped Personal Notes

  • Add notes at any point in the interview timeline
  • Categorize notes (improvement, strength, mistake, learning, question-analysis, general)
  • Tag notes with custom keywords for easy searching
  • Edit or delete notes anytime
  • Maximum 100 notes per interview

3. Smart Bookmarks

  • Quick-jump to important moments
  • Auto-label bookmarks by type (question, answer, feedback, highlight)
  • Maximum 50 bookmarks per interview
  • One-click navigation to bookmarked sections

4. Global Search

  • Search across all your notes and bookmarks
  • Find specific topics or insights quickly
  • Filter by interview, date, or category
  • See context with matched notes

5. View Tracking & Analytics

  • Track how many times you've reviewed each interview
  • Monitor total watch time for self-reflection
  • Identify most-reviewed sections
  • Track improvement areas vs strengths

6. Sharing & Collaboration

  • Generate secure share links for replays
  • Share with mentors, study buddies, or career counselors
  • Revoke access anytime
  • Control privacy settings per replay

7. Resume Functionality

  • Automatically save playback position
  • Resume watching from where you left off
  • Never lose your place during long review sessions

📊 Use Cases

For Candidates

  • Post-Interview Review: Immediately after interview, review performance while fresh
  • Weekly Progress Check: Compare interviews from this week vs last week
  • Pre-Interview Prep: Review common mistakes before upcoming interviews
  • Self-Reflection: Add notes on what to improve for next time
  • Pattern Recognition: Identify recurring weaknesses across multiple interviews

For Mentors

  • Student Evaluation: Review shared replays to provide targeted feedback
  • Teaching Tool: Use replays to demonstrate good vs bad interview techniques
  • Progress Monitoring: Track mentee improvement over time

For Study Buddies

  • Peer Review: Exchange replays and give each other feedback
  • Learning Together: Compare notes on similar interviews
  • Mock Interview Analysis: Review practice sessions together

🛠️ Technical Implementation

Architecture

┌─────────────────────────────────────────────────────┐
│  Interview Replay System Architecture               │
├─────────────────────────────────────────────────────┤
│                                                      │
│  ┌──────────────┐         ┌──────────────┐         │
│  │   Frontend   │────────▶│   Backend    │         │
│  │  (React UI)  │         │  (Express)   │         │
│  └──────────────┘         └──────────────┘         │
│         │                        │                  │
│         ▼                        ▼                  │
│  ┌──────────────┐         ┌──────────────┐         │
│  │   Replay     │         │   MongoDB    │         │
│  │  Component   │         │  Collections │         │
│  └──────────────┘         └──────────────┘         │
│         │                        │                  │
│         ├────────────────────────┤                  │
│         │                        │                  │
│         ▼                        ▼                  │
│  ┌─────────────────────────────────────────┐      │
│  │  InterviewReplay Model                   │      │
│  │  - notes, bookmarks, tracking           │      │
│  └─────────────────────────────────────────┘      │
│                                                      │
└─────────────────────────────────────────────────────┘

Database Schema

InterviewReplay Model

{
  interviewId: ObjectId,      // Reference to Interview
  userId: ObjectId,            // Reference to User
  sessionId: ObjectId,         // Reference to InterviewSession
  
  // Tracking
  viewCount: Number,
  lastViewedAt: Date,
  totalWatchTime: Number,      // in seconds
  
  // Notes
  notes: [{
    timestamp: Number,          // seconds from start
    conversationIndex: Number,  // which message
    noteText: String,
    category: String,           // improvement, strength, etc.
    tags: [String],
    isBookmarked: Boolean,
    createdAt: Date,
    updatedAt: Date
  }],
  
  // Bookmarks
  bookmarks: [{
    conversationIndex: Number,
    label: String,
    timestamp: Number,
    type: String,              // question, answer, feedback, etc.
    createdAt: Date
  }],
  
  // Resume functionality
  lastPlaybackPosition: {
    conversationIndex: Number,
    timestamp: Number
  },
  
  // Sharing
  isPublic: Boolean,
  shareToken: String,          // unique share link
  
  timestamps: true
}

API Endpoints

Replay Access

GET    /api/replay/:interviewId              Get or create replay
GET    /api/replay/shared/:shareToken        Get shared replay (public)
GET    /api/replay/my-replays                Get all user's replays
GET    /api/replay/stats                     Get replay statistics

View Tracking

POST   /api/replay/:replayId/view            Track replay view
PUT    /api/replay/:replayId/position        Update playback position

Notes Management

POST   /api/replay/:replayId/notes           Add note
PUT    /api/replay/:replayId/notes/:noteId   Update note
DELETE /api/replay/:replayId/notes/:noteId   Delete note
GET    /api/replay/search/notes?q=query      Search notes

Bookmarks Management

POST   /api/replay/:replayId/bookmarks           Add bookmark
DELETE /api/replay/:replayId/bookmarks/:bookmarkId Delete bookmark

Sharing

POST   /api/replay/:replayId/share           Generate share link
DELETE /api/replay/:replayId/share           Revoke share access

Request/Response Examples

Get Replay

Request:

GET /api/replay/507f1f77bcf86cd799439011
Authorization: Bearer <token>

Response:

{
  "success": true,
  "data": {
    "replay": {
      "_id": "...",
      "interviewId": {
        "role": "Senior Backend Engineer",
        "difficulty": "hard",
        "overallScore": 78,
        "completedAt": "2026-01-15T10:30:00Z"
      },
      "viewCount": 3,
      "lastViewedAt": "2026-01-17T08:00:00Z",
      "notes": [...],
      "bookmarks": [...],
      "lastPlaybackPosition": {
        "conversationIndex": 15,
        "timestamp": 450
      }
    },
    "conversation": [
      {
        "role": "assistant",
        "content": "Hello! Welcome to your interview...",
        "type": "greeting",
        "timestamp": "2026-01-15T10:00:00Z"
      },
      {
        "role": "user",
        "content": "Thank you for the opportunity...",
        "type": "answer",
        "timestamp": "2026-01-15T10:01:00Z"
      }
    ],
    "scores": {
      "technical": 8,
      "communication": 7,
      "problemSolving": 8
    }
  }
}

Add Note

Request:

POST /api/replay/507f1f77bcf86cd799439011/notes
Authorization: Bearer <token>
Content-Type: application/json

{
  "timestamp": 125,
  "conversationIndex": 5,
  "noteText": "I should have mentioned database indexing here for better performance",
  "category": "improvement",
  "tags": ["database", "performance", "indexing"],
  "isBookmarked": true
}

Response:

{
  "success": true,
  "message": "Note added successfully",
  "data": {
    "note": {
      "_id": "...",
      "timestamp": 125,
      "conversationIndex": 5,
      "noteText": "I should have mentioned database indexing...",
      "category": "improvement",
      "tags": ["database", "performance", "indexing"],
      "isBookmarked": true,
      "createdAt": "2026-01-17T12:00:00Z"
    },
    "notesCount": 8
  }
}

Search Notes

Request:

GET /api/replay/search/notes?q=database
Authorization: Bearer <token>

Response:

{
  "success": true,
  "data": {
    "query": "database",
    "resultsCount": 5,
    "results": [
      {
        "interviewId": "...",
        "interviewRole": "Backend Developer",
        "interviewDifficulty": "medium",
        "interviewDate": "2026-01-10T...",
        "replayId": "...",
        "matchingNotes": [
          {
            "noteText": "Forgot to mention database sharding...",
            "category": "mistake",
            "timestamp": 180
          }
        ]
      }
    ]
  }
}

🎨 Frontend Integration

Example React Component Structure

// ReplayViewer.jsx
const ReplayViewer = ({ interviewId }) => {
  const [replay, setReplay] = useState(null);
  const [currentIndex, setCurrentIndex] = useState(0);
  const [notes, setNotes] = useState([]);
  
  // Load replay data
  useEffect(() => {
    loadReplay(interviewId);
  }, [interviewId]);
  
  // Add note at current position
  const handleAddNote = (noteText, category) => {
    addNote({
      timestamp: currentTimestamp,
      conversationIndex: currentIndex,
      noteText,
      category
    });
  };
  
  return (
    <div className="replay-viewer">
      <ConversationTimeline 
        messages={replay.conversation}
        currentIndex={currentIndex}
        onSeek={setCurrentIndex}
      />
      <NotesPanel 
        notes={notes}
        onAdd={handleAddNote}
        onEdit={handleUpdateNote}
      />
      <BookmarksBar 
        bookmarks={replay.bookmarks}
        onJump={jumpToBookmark}
      />
    </div>
  );
};

UI Components Needed

  1. ReplayViewer - Main container
  2. ConversationTimeline - Shows interview flow with playback controls
  3. NotesPanel - Add/edit/delete notes sidebar
  4. BookmarksBar - Quick navigation to bookmarks
  5. SearchBar - Global notes search
  6. ShareModal - Generate and manage share links
  7. StatsCard - Display replay statistics

📈 Benefits

For Users

  • Better Learning: Review and learn from every interview
  • Pattern Recognition: Identify recurring strengths/weaknesses
  • Structured Improvement: Track progress with notes and categories
  • Memory Aid: Never forget important interview moments
  • Confidence Building: See improvement over time

For Platform

  • Increased Engagement: Users return to review interviews
  • Higher Retention: Valuable feature increases stickiness
  • Social Proof: Shareable replays attract new users
  • Premium Feature: Can be monetized as part of premium tier
  • Data Insights: Understand what users focus on most

🔒 Security & Privacy

Data Protection

  • All replay data is private by default
  • Share tokens are cryptographically secure (32-byte random hex)
  • Users can revoke share access anytime
  • Shared replays only show conversation data, not personal info

Access Control

  • Authentication required for all private endpoints
  • Users can only access their own replays
  • Share tokens provide read-only access
  • No modification allowed on shared replays

Performance Considerations

  • Indexed database queries for fast retrieval
  • Pagination for large replay lists
  • Efficient note searching with text indexes
  • Limit on notes (100) and bookmarks (50) per interview

📱 Usage Examples

Example 1: Post-Interview Self-Review

// User just completed interview
const interview = await completeInterview(sessionId);

// Navigate to replay
router.push(`/replay/${interview._id}`);

// User adds notes while reviewing
await addNote({
  conversationIndex: 8,
  noteText: "Next time, mention my AWS Lambda experience here",
  category: "improvement",
  tags: ["aws", "cloud", "lambda"]
});

Example 2: Mentor Review

// Candidate shares replay with mentor
const shareLink = await generateShareLink(replayId);
// shareLink: "https://intervyo.xyz/replay/shared/abc123..."

// Mentor opens shared link (no auth needed)
const sharedReplay = await getSharedReplay(shareToken);

// Mentor provides feedback via separate channel

Example 3: Weekly Progress Review

// Get all replays from this week
const replays = await getMyReplays({
  page: 1,
  sortBy: 'createdAt',
  order: 'desc'
});

// Search notes for "improvement" category
const improvements = replays.filter(r => 
  r.notes.some(n => n.category === 'improvement')
);

// Analyze patterns
console.log("Areas to improve:", 
  improvements.flatMap(r => r.notes.map(n => n.tags))
);

🚀 Future Enhancements

Phase 2 Features (Potential)

  • AI-Powered Insights: Automatic analysis of notes to suggest focus areas
  • Comparison View: Side-by-side comparison of two interviews
  • Video Replay: Add video recording of candidate (optional)
  • Audio Playback: Replay voice answers if recorded
  • Export to PDF: Generate downloadable review reports
  • Social Learning: Public replay library for community learning
  • Collaborative Notes: Allow mentors to add notes on shared replays
  • Quiz Mode: Generate quiz questions from interview to test retention

🎓 Best Practices

For Candidates

  1. Review interview within 24 hours while fresh
  2. Add notes for both strengths and improvements
  3. Use consistent tags for easy searching later
  4. Bookmark questions you want to practice more
  5. Review replays weekly to track progress
  6. Share with mentor for expert feedback

For Mentors

  1. Focus on constructive feedback
  2. Highlight both positives and areas to improve
  3. Provide specific, actionable advice
  4. Point out patterns across multiple reviews

📝 Implementation Checklist

  • Create InterviewReplay model
  • Build replay controller with all endpoints
  • Set up routes and authentication
  • Integrate with main Express app
  • Build frontend replay viewer component
  • Add notes panel UI
  • Implement bookmark navigation
  • Create search interface
  • Add share functionality UI
  • Write frontend tests
  • Write backend tests
  • Add analytics tracking
  • Update API documentation
  • Create user guide

🐛 Testing Scenarios

Unit Tests

  • Note CRUD operations
  • Bookmark CRUD operations
  • View tracking accuracy
  • Share token generation/validation
  • Search functionality

Integration Tests

  • Full replay lifecycle (create → view → note → share)
  • Authentication and authorization
  • Database transactions
  • Error handling

E2E Tests

  • User completes interview → reviews replay → adds notes → shares with mentor
  • Search across multiple replays
  • Resume playback from saved position

📚 Related Documentation

🎯 Success Metrics

Track these metrics to measure feature success:

  • Replay Creation Rate: % of completed interviews that are reviewed
  • Average Views per Replay: How many times users re-watch
  • Notes per Replay: Engagement with note-taking feature
  • Share Rate: % of replays that are shared
  • Search Usage: How often users search their notes
  • Weekly Active Reviewers: Users who review replays regularly

🤝 Contributing

When contributing to the replay system:

  1. Follow existing code patterns in model/controller/routes
  2. Add proper error handling and validation
  3. Write tests for new features
  4. Update this documentation
  5. Consider performance impact of new queries

📄 License

This feature is part of Intervyo platform. See LICENSE file for details.


Created by: [Your Name]
Date: January 17, 2026
Version: 1.0.0
Status: ✅ Backend Complete | ⏳ Frontend Pending