Frontend School

Bigbasket Inventory Management Dashboard

Machine Coding
hard

Bigbasket Inventory Management Dashboard

Hard
React
TypeScript
Data Table
Sorting
Filtering
UI/UX
State Management

Overview

Bigbasket store managers need an efficient and interactive dashboard to monitor product inventory across various categories. This tool is crucial for quickly identifying low-stock items, popular products, or products needing immediate attention to maintain optimal stock levels and ensure customer satisfaction. Your task is to build a core part of this dashboard: a dynamic product inventory table that supports client-side sorting and filtering.

What you need to do / Task

Your primary goal is to develop a functional and user-friendly product inventory table using React and TypeScript, incorporating the following features:

  1. Display Product Data: Render a table displaying product information, including id, name, category, price, stock, and lastUpdated.
  2. Client-Side Sorting: Implement sorting functionality for the name, price, stock, and category columns. Clicking a column header should toggle between ascending, descending, and no sort (or reset to default for that column).
  3. Product Name Search: Add an input field above the table to allow users to search for products by their name. The search should be case-insensitive and filter results as the user types.
  4. Category Filtering: Implement a dropdown (or multi-select) filter to allow users to view products belonging to specific category/categories. The filter should update the table dynamically.
  5. Combined Functionality: Ensure that sorting and filtering can be applied simultaneously and work correctly together.
  6. Empty States: Gracefully handle scenarios where no products match the current filters or search criteria.

UI/UX expectations

  • Layout: A clean, tabular layout for displaying product information. Controls for search and filter should be positioned clearly above the table.
  • Interactions:
    • Table headers should be clickable to trigger sorting. Provide a visual indicator (e.g., an arrow icon or text) for the current sort direction (ascending/descending).
    • Search input should update results in real-time as the user types.
    • Category filter should update results upon selection.
  • Responsiveness: The table should be reasonably responsive on a standard desktop browser viewport (e.g., not break layout on slight resizing).
  • Accessibility: Basic accessibility considerations for interactive elements (e.g., keyboard navigability for input/select, appropriate semantic HTML).

Acceptance criteria

  • The table successfully displays all mock product data initially.
  • Clicking a sortable column header correctly sorts the products in ascending, then descending order, and resets.
  • Typing into the product name search input accurately filters the product list (case-insensitive).
  • Selecting a category from the filter dropdown correctly displays only products from that category.
  • Applying both search and category filters, followed by sorting, yields the correct, combined result set.
  • An appropriate message is displayed when no products match the active filters or search.
  • The user interface is intuitive, functional, and free of console errors.

Constraints

Constraints & assumptions

  • Technology Stack: React with TypeScript.
  • Data Source: All product data will be provided as a static mock array within App.tsx. No API calls are required.
  • Rendering: All sorting and filtering logic must be implemented client-side.
  • Libraries: Avoid using heavy third-party UI component libraries (e.g., Material UI, Ant Design, React Table). Implement core UI components (table, input, select) yourself to demonstrate foundational understanding. Small utility libraries are acceptable if justified.
  • Performance: Optimize for a dataset of up to 100-200 items. While mock data will be smaller, consider efficiency.
  • Time Budget: This problem is designed to be completable within approximately 45 minutes.

Out of scope

  • Pagination for the table.
  • Server-side data fetching, sorting, or filtering.
  • Advanced accessibility features (e.g., full screen reader support beyond basic semantic HTML and ARIA attributes).
  • Full, pixel-perfect responsive design for all mobile screen sizes.
  • Features like adding, editing, or deleting products.

What interviewers evaluate

  • Correctness and Robustness: Accuracy of sorting and filtering logic, including edge cases and combined functionality.
  • Code Quality: Readability, maintainability, modularity, and adherence to best practices for React and TypeScript.
  • State Management: Effective use of React hooks (useState, useEffect, useMemo) for managing UI state and derived data.
  • UI/UX Implementation: Attention to detail in building an interactive and user-friendly interface with basic accessibility.

Loading editor...