FrontendInterviews.dev

Loading problem…

58. Todo List III

Hard•
Acceptance: 46.00%
•
🔓3/3 Pro unlocks today

This problem builds on todo-list-ii. Complete that first, then load your solution to continue.

Build a production-ready Todo List component with categories, undo/redo functionality, search, and bulk operations.

Advanced Features

1. Categories/Tags

  • Add categories to todos (e.g., "Work", "Personal", "Shopping")
  • Filter todos by category
  • Show category badges
  • Create new categories on the fly

2. Undo/Redo Functionality

  • Undo last action (add, delete, toggle, etc.)
  • Redo undone actions
  • Keyboard shortcuts (Ctrl+Z, Ctrl+Y)
  • Visual indication of undo/redo availability

3. Search Functionality

  • Real-time search across todo text
  • Highlight matching text
  • Search filters active todos

4. Due Dates and Reminders

  • Add due dates to todos
  • Show overdue todos
  • Sort by due date

5. Bulk Operations

  • Select multiple todos
  • Bulk delete
  • Bulk toggle completion
  • Bulk assign category

6. Enhanced Data Structure

interface Todo {
  id: number;
  text: string;
  completed: boolean;
  order: number;
  category?: string;
  dueDate?: string; // ISO date string
  createdAt: string;
}

interface HistoryState {
  todos: Todo[];
  timestamp: number;
}

Constraints

  • Implement undo/redo using a history stack
  • Handle keyboard shortcuts globally
  • Maintain performance with large todo lists
  • Persist all data to localStorage