Frontend School

Delhivery Shipment Detail Explorer

Machine Coding
hard

Delhivery Shipment Detail Explorer

Hard
React
UI
Split Pane
Resizing
Event Handling
CSS

Overview

Operations managers at Delhivery frequently need to examine individual shipment details while simultaneously reviewing the complete historical lifecycle of that shipment. A fixed layout for these two crucial information blocks can hinder efficient analysis and comparison. This problem requires you to build a dynamic interface that allows users to resize the detail and history sections, significantly enhancing their analytical workflow and productivity.

What you need to do / Task

  1. Layout Construction: Build a React component that displays two distinct content panes: "Shipment Details" on the left and "Shipment History" on the right.
  2. Resizable Divider: Implement a draggable divider element positioned between the two panes.
  3. Dynamic Resizing: Ensure that dragging the divider horizontally dynamically adjusts the widths of both "Shipment Details" and "Shipment History" panes.
  4. Minimum Pane Sizes: Enforce a minimum width (e.g., 200px) for each pane, preventing them from becoming too small during resizing.
  5. Data Display: Populate both panes with the provided mock data, ensuring it renders responsively within the resized containers.

UI/UX expectations

  • Initial State: The application should render with the "Shipment Details" pane occupying 60% of the width and the "Shipment History" pane occupying 40% of the width, separated by a visible divider.
  • Divider Interaction: Hovering over the divider should visually indicate resizability by changing the cursor to ew-resize.
  • Smooth Resizing: Dragging the divider should provide a smooth, real-time resizing experience for both panes.
  • Content Adaptation: Content within each pane (mock data) should reflow and adapt correctly to the new dimensions without overflow or layout issues.

Acceptance criteria

  • The application renders two distinct sections: "Shipment Details" and "Shipment History", with a visible divider between them.
  • The initial split ratio is approximately 60% for details and 40% for history.
  • Dragging the divider horizontally successfully resizes both sections, maintaining their relative positions.
  • The cursor changes to ew-resize when hovering over the divider.
  • Both the "Shipment Details" and "Shipment History" panes enforce a minimum width (e.g., 200px) during resizing.
  • The provided mock data is rendered clearly and correctly within its respective pane.

Constraints

Constraints & assumptions

  • You must use React for building the UI.
  • You are not allowed to use any external libraries for split pane functionality (e.g., react-split-pane, re-resizable). Implement the resizing logic from scratch.
  • The split should be horizontal only (left and right panes).
  • The component should occupy 100% of the available width and height of its parent container.
  • Mock data will be provided in the App.tsx starter file.
  • The minimum width for each pane should be 200px.

Out of scope

  • Persisting the split pane state (e.g., saving the last split position).
  • Keyboard accessibility for resizing the panes.
  • Vertical splitting or nested split panes.
  • Server-side data fetching or integration with real APIs.
  • Advanced styling beyond basic layout and visual feedback.

What interviewers evaluate

  • Component Design & Structure: How well the React components are organized, their separation of concerns, and effective use of props/state.
  • State Management & Event Handling: Correct and efficient use of React state for managing pane dimensions, and robust implementation of mouse events (mousedown, mousemove, mouseup) for dragging.
  • CSS & Layout: Proficiency in creating a flexible and responsive layout using modern CSS techniques (e.g., Flexbox) to accommodate dynamic resizing.
  • Code Quality & Readability: Clarity, maintainability, and adherence to best practices in JavaScript/TypeScript and React development.

Loading editor...