Frontend School

Dynamic Inventory Explorer with Virtualized Table

Machine Coding
hard

Dynamic Inventory Explorer with Virtualized Table

Hard
React
TypeScript
Virtualization
Table
Sorting
Filtering
Performance
UI/UX

Overview

Flipkart's vast product catalog requires efficient tools for inventory management. As a critical component for sellers and internal teams, displaying and interacting with large datasets of products without performance bottlenecks is paramount. This problem challenges you to build a high-performance, interactive table component that can handle thousands of product entries, leveraging virtualization, sorting, and filtering capabilities.

What you need to do / Task

Your primary task is to develop a React component that displays a list of products in a performant, interactive table. You will be provided with mock product data.

  1. Virtualized Table Implementation: Implement a virtualized table to efficiently render a large number of rows (e.g., 10,000+ items). This means only rendering the visible rows, not all rows in the dataset.
  2. Display Product Data: The table should display product information including ID, Name, Category, Price, Stock, and Last Updated.
  3. Client-Side Sorting: Enable sorting functionality for Name, Category, Price, and Stock columns. Clicking a column header should toggle between ascending, descending, and no sort states for that column.
  4. Client-Side Filtering: Implement multiple filtering options:
    • Text Search: Filter by Name and Category using a text input field (case-insensitive substring match).
    • Range Filtering: Filter by Price (min/max) and Stock (min/max) using numerical input fields.
  5. Integration: Ensure that sorting and filtering work seamlessly together and with the virtualization. Applying filters or changing sort order should correctly update the displayed virtualized list.

UI/UX expectations

  • Layout: A clean, responsive table layout with clearly defined columns.
  • Interactions: Sortable column headers should have visual indicators (e.g., arrows) showing the current sort direction. Filter input fields should be intuitive and allow users to quickly narrow down results.
  • Performance: Scrolling through the table should be smooth and lag-free, even with a large number of total items.
  • Responsiveness: The table should adapt reasonably to different screen widths (though full mobile responsiveness is not the primary focus).

Acceptance criteria

  • The table successfully renders 10,000+ product items using virtualization, avoiding browser performance issues during scrolling.
  • Clicking on sortable column headers (Name, Category, Price, Stock) correctly sorts the data in ascending and descending order.
  • Filtering by Name and Category text inputs accurately narrows down the displayed products.
  • Filtering by Price and Stock range inputs correctly filters products based on min/max values.
  • All filters and sorting criteria can be combined, and the virtualized table updates correctly and efficiently.
  • The UI provides clear visual feedback for active sorting states.
  • The application is free of console errors related to React keys or performance warnings.

Constraints

Constraints & assumptions

  • Data Size: The mock data will consist of at least 10,000 product objects. Your solution must handle this scale efficiently.
  • Environment: React application running in a browser. TypeScript is mandatory.
  • Client-Side Operations: All sorting and filtering must be performed client-side. There are no backend API calls to implement.
  • Virtualization Library: You are encouraged to use a well-known virtualization library like react-window or react-virtualized to manage rendering efficiency. Custom virtualization is allowed but may take more time.
  • Data Structure: The Product interface and mock data generation are provided in App.tsx.

Out of scope

  • Server-side pagination, sorting, or filtering.
  • Complex form validation for filter inputs (basic type checking is sufficient).
  • Advanced accessibility features beyond semantic HTML where applicable.
  • Extensive styling or theming (focus on functionality and basic usability).

What interviewers evaluate

  • Performance & Efficiency: How well the virtualized table handles large datasets and maintains smooth interactions.
  • Correctness & Robustness: Accuracy of sorting and filtering logic, and how well edge cases are handled.
  • Code Quality: Structure, maintainability, readability, and adherence to React/TypeScript best practices.
  • Problem Solving: Ability to integrate multiple complex features (virtualization, sorting, filtering) effectively.

Loading editor...