Frontend School

Netflix Production Schedule Visualizer

Machine Coding
hard

Netflix Production Schedule Visualizer

Hard
UI
Frontend
React
Data Visualization
Gantt Chart

Overview

Netflix produces a vast array of content, requiring meticulous planning and scheduling across various teams. Visualizing these complex timelines is crucial for tracking progress, identifying bottlenecks, and ensuring timely delivery. In this problem, you'll build a simplified Gantt chart component to help production managers visualize episode and post-production schedules. This exercise focuses on rendering dynamic, date-based data into an intuitive UI, a common challenge in many Netflix internal tools.

What you need to do / Task

Your primary task is to create a React component that displays a Gantt chart:

  1. Render Tasks: Display a list of production tasks as horizontal bars on a timeline. Each task has a category, name, startDate, and endDate.
  2. Category Grouping (Swimlanes): Group tasks by their category. Each category should have its own "swimlane" in the chart, making it easy to see all tasks belonging to that category together.
  3. Timeline Header: Implement a dynamic header displaying the dates covered by the chart. For simplicity, assume a daily granularity.
  4. Date Calculation & Positioning: Accurately calculate the width and horizontal position (left CSS property) of each task bar based on its startDate, endDate, and the overall timeline scale.
  5. Horizontal Scrolling: The chart should be horizontally scrollable if the total timeline width exceeds the viewport.
  6. Task Details on Hover: When a user hovers over a task bar, display a tooltip or popover showing the task's name, startDate, and endDate.
  7. Visual Distinction for Overlapping Tasks: If multiple tasks within the same category overlap significantly, ensure they are visually distinct (e.g., slightly offset vertically or stacked clearly within their swimlane).

UI/UX expectations

  • The overall layout should be clean and easy to read, resembling a classic Gantt chart.
  • Tasks should be represented by distinct colored bars. Use the provided color for each category's tasks.
  • The timeline header should clearly indicate days.
  • Horizontal scrolling should be smooth and intuitive.
  • The hover tooltip should appear near the hovered task and disappear when the mouse leaves.
  • Each category's swimlane should be clearly labeled.

Acceptance criteria

  • The Gantt chart component renders without errors.
  • All provided Task data is displayed visually on the timeline.
  • Tasks are correctly grouped under their respective Category labels.
  • Task bars accurately reflect their startDate and endDate on the timeline.
  • The timeline header displays a sequence of dates, corresponding to the visible chart range.
  • The chart supports horizontal scrolling when the content width exceeds the container.
  • Hovering over a task bar displays a tooltip with the task's name, startDate, and endDate.
  • Overlapping tasks within the same category are visually distinguishable (e.g., by vertical offset).

Constraints

Constraints & assumptions

  • You are provided with mock data for tasks and categories.
  • The timeline will cover a fixed period (defined in App.tsx as chartStartDate and chartEndDate).
  • Focus on client-side rendering; no backend integration is required.
  • You should implement the Gantt chart using standard React and CSS (e.g., Flexbox or CSS Grid). Avoid external Gantt chart libraries.
  • The number of tasks will be moderate (e.g., up to 50-100 tasks across 5-10 categories). Performance should be reasonable for this scale.
  • Dates will be standard JavaScript Date objects.

Out of scope

  • Interactions like dragging, resizing, or creating new tasks.
  • Zooming in/out the timeline granularity (e.g., switching from daily to weekly view).
  • Complex filtering or sorting of tasks.
  • Accessibility for screen readers (though good semantic HTML is always a plus).

What interviewers evaluate

  • Component Design & Structure: How well the problem is broken down into modular, reusable React components.
  • Data Handling & Logic: Accuracy in calculating task positions and widths based on dates, and managing state effectively.
  • CSS & Layout: Proficiency in using modern CSS (Flexbox/Grid) to create a responsive and visually appealing chart.
  • UI/UX Implementation: Attention to detail in implementing interactive elements like hover tooltips and horizontal scrolling.

Loading editor...