Frontend School

Dynamic Project Task Management Table

Machine Coding
medium

Dynamic Project Task Management Table

Medium
React
TypeScript
Data Table
Sorting
Filtering
UI

Overview

Livspace manages numerous interior design projects, each comprising various tasks such as design, procurement, and installation. Project managers require a centralized, interactive dashboard to efficiently track task progress, assignees, and deadlines. This problem challenges you to build a core component of such a dashboard: a dynamic table capable of displaying project tasks with robust client-side sorting and filtering capabilities.

What you need to do / Task

Your goal is to implement a React component that displays a list of project tasks in a table format, allowing users to interactively sort and filter the data.

  1. Display Task Data: Render a table displaying the provided mock Task data.
  2. Sortable Columns: Implement client-side sorting for the Task Name, Deadline, and Status columns. Clicking a header should sort the table by that column, toggling between ascending and descending order on successive clicks.
  3. Status Filter: Add a dropdown (select) filter that allows users to view tasks based on their status (e.g., 'All', 'Pending', 'In Progress', 'Completed').
  4. Text Search Filter: Implement a text input field that filters tasks by matching the input string (case-insensitive) against either the taskName or assignee fields.
  5. Combined Functionality: Ensure that sorting and all filtering mechanisms can be applied simultaneously and work correctly in combination.

UI/UX expectations

  • Clear Table Layout: The table should have clear headers and distinct rows for each task.
  • Sort Indicators: Table headers for sortable columns should visually indicate the current sort order (e.g., an arrow icon or text like '▲'/'▼').
  • Filter Controls: Provide clearly labeled input fields for the search and status filters, positioned above the table.
  • Responsiveness (Basic): The table should be reasonably usable on standard desktop browser widths. Focus on functionality over pixel-perfect design.
  • Empty State: Display a message if no tasks match the current filter/search criteria.

Acceptance criteria

  • The table renders all mockTasks data correctly on initial load.
  • Clicking the Task Name header sorts tasks alphabetically (A-Z, then Z-A).
  • Clicking the Deadline header sorts tasks chronologically (earliest to latest, then latest to earliest).
  • Clicking the Status header sorts tasks alphabetically (A-Z, then Z-A).
  • Selecting a status from the dropdown correctly filters the tasks to show only those with the chosen status.
  • Typing text into the search input filters tasks whose taskName or assignee contains the search term (case-insensitive).
  • All sorting and filtering features (status filter, text search, column sorting) can be combined and function correctly.
  • No console errors or warnings are present during normal operation.

Constraints

Constraints & assumptions

  • You must use React with TypeScript.
  • All data operations (sorting, filtering) must be performed client-side using the provided mockTasks data.
  • No external UI component libraries (e.g., Material-UI, Ant Design, Chakra UI) are allowed for core table or input components. Use standard HTML elements and basic CSS.
  • The provided mockTasks array is the sole source of data.
  • Focus on functionality and clean, maintainable code rather than extensive styling or complex animations.

Out of scope

  • Pagination or infinite scrolling.
  • Server-side data fetching, filtering, or sorting.
  • Advanced accessibility features beyond basic semantic HTML.
  • Drag-and-drop functionality for table rows or columns.
  • Editing or deleting tasks.

What interviewers evaluate

  • Correctness: Accurate implementation of all sorting and filtering logic.
  • Code Quality: Clean, readable, and maintainable React component structure and logic.
  • State Management: Effective use of React's state (e.g., useState, useMemo) for managing UI interactions and data transformations.
  • TypeScript Usage: Proper type definitions and strong typing throughout the component.

Loading editor...