Back to Gusto questions
CodingSoftware Engineer

Peak Business Activity

Frequency: Reported


Reported prompt

You are given a CSV dataset containing company start and end dates. Find the period with the greatest amount of business activity.

csv
company,start_date,end_date
Innovate Inc.,1995,2015
Quantum Corp.,2005,2020
Nebula LLC,1998-03-15,2018-09-01
Starlight Ltd.,2010-07-22,2022-05-30
Fusion Systems,2005,2022
Galaxy Co.,2015-01-10,2021-12-31

Part 1: peak year

Assume dates are given only as years. A company is active for its entire start and end years, inclusive. Return a year with the maximum number of active companies. If several years tie, any peak year is valid.

Part 2: peak day

Assume dates use YYYY-MM-DD. A company is active on every day from start_date through end_date, inclusive. Return a date with the maximum number of active companies. If several dates tie, any peak date is valid.

Other reports said the data could be CSV or JSON and might be provided through a URL.