Frontend School

Dynamic Chart Configuration Panel

Machine Coding
hard

Dynamic Chart Configuration Panel

Hard
React
TypeScript
Data Visualization
UI/UX
State Management

Overview

Intuit's core mission involves empowering users with financial insights. A critical component of our data visualization tools is the ability for users to customize how their data is presented. This problem focuses on building a dynamic configuration panel for a chart, allowing users to select key data dimensions and aggregation methods, which then dictates how a hypothetical chart would render.

What you need to do / Task

Your goal is to implement a ChartConfigurator component that allows users to define the X-axis, Y-axis, and an aggregation method for a dataset.

  1. Render a configuration panel: Create a UI with three distinct dropdowns:
    • X-Axis: Selects a dimension for the X-axis from available dataset fields.
    • Y-Axis: Selects a dimension for the Y-axis from available dataset fields.
    • Aggregation: Selects an aggregation method (e.g., 'Sum', 'Average', 'Count') to apply to the Y-axis data.
  2. Dynamic Data Display: Below the configuration controls, display the simulated processed data based on the current selections. This processed data should reflect the chosen X-axis, Y-axis, and aggregation.
  3. Default Selections: Initialize the configurator with sensible default selections for X-axis, Y-axis, and Aggregation.
  4. State Management: Ensure that changing any dropdown selection immediately updates the displayed processed data.
  5. Input Validation/Feedback: Prevent selecting the same field for both X-axis and Y-axis. If this occurs, display an appropriate error message and prevent data processing. Additionally, consider how to handle aggregation methods ('Sum', 'Average') if the chosen Y-axis field is non-numeric.

UI/UX expectations

  • The configuration panel should be clearly laid out, with labels for each dropdown.
  • Dropdowns should be standard HTML select elements or a simple custom equivalent.
  • The "Processed Data" display area should show the results in a readable format (e.g., a simple list or table).
  • Error messages (e.g., for duplicate axis selection or invalid aggregation) should be clearly visible and accessible.
  • Basic styling for readability and separation of elements is expected (e.g., using flexbox/grid for layout, padding, margins).

Acceptance criteria

  • The component renders three dropdowns: X-Axis, Y-Axis, and Aggregation.
  • Dropdowns are populated with appropriate options (dataset fields for axes, aggregation types for aggregation).
  • Changing any dropdown selection dynamically updates the displayed processed data.
  • The "Processed Data" output correctly reflects the chosen X-axis, Y-axis, and aggregation.
  • A user cannot select the same field for both X-Axis and Y-Axis. An error message is displayed if this condition is met, and data processing is halted.
  • If a non-numeric field is selected for Y-Axis and the aggregation method is 'Sum' or 'Average', an appropriate error message is displayed, and data processing is halted.
  • The component initializes with valid default selections and displays corresponding processed data.
  • The UI is reasonably styled for clarity and usability.

Constraints

Constraints & assumptions

  • You will be provided with a mock dataset and a list of available aggregation methods.
  • Focus on functional implementation using React and TypeScript.
  • No external charting libraries (e.g., D3, Chart.js) are needed; simply display the processed data.
  • The aggregation logic should be implemented directly within your component or a helper function.
  • The time budget is approximately 45 minutes. Prioritize core functionality and clean code over extensive error handling or highly polished UI.

Out of scope

  • Implementing a full-fledged chart visualization.
  • Backend integration or API calls.
  • Extensive styling beyond basic layout and readability.
  • Complex accessibility features beyond standard HTML elements and clear labeling.

What interviewers evaluate

  • React Proficiency & State Management: Effective use of React hooks, component structure, and managing component state for dynamic UI updates.
  • TypeScript Usage: Correct and idiomatic application of TypeScript for data structures, component props, and state, including type guards where necessary.
  • Data Transformation & Logic: Ability to implement data grouping and aggregation logic correctly based on user selections and handle different data types.
  • UI/UX Implementation: Adherence to UI/UX expectations, including clear layout, interactive elements, and effective user feedback for errors.
  • Code Quality & Maintainability: Readability, modularity, and a clean approach to solving the problem within the given constraints.

Loading editor...