FrontendArk

Master Frontend Interviews

  • Practice
  • Playground
  • Resource
Medium

Birth Year Histogram

45 mins

Build a widget that fetches birth year data from an API and plots it on a histogram.

Requirements:

  1. Fetch data from an API endpoint (you can mock with https://dummyjson.com/users which has birthDate).
  2. Extract the birth year from each user’s birthDate.
  3. Count how many people were born in each year.
  4. Display the counts in a simple histogram (bars with heights corresponding to counts).
  5. Include axis labels for clarity.
  6. Focus on functionality over styling.

Code Editor

React Component

00:00
Loading...

Live Preview

See your React component