The annual report wants revenue per year and the change against the year before — but the business did not trade every year, and one year's refunds cancelled its sales exactly.
One row per calendar year that has at least one order, with the columns:
year — 'YYYY' as a stringrevenue — that year's total amountprev_revenue — the immediately preceding calendar year's revenue, or null if that year has no orders at allyoy_pct — (revenue - prev_revenue) / prev_revenue * 100| year | revenue | prev_revenue | yoy_pct |
|---|---|---|---|
| 2023 | 100.0 | null | null |
| 2024 | 150.0 | 100.0 | 50.0 |
prev_revenue and yoy_pct are both null, and reaching back to 2022 is wrong.prev_revenue is 0.0, but the percentage is undefined, so yoy_pct is null. Not infinity, not zero.orders| amount | order_id | ordered_at |
|---|---|---|
| 60 | 1 | 2023-03-01T00:00:00Z |
| 40 | 2 | 2023-09-01T00:00:00Z |
| 150 | 3 | 2024-02-01T00:00:00Z |
| year | revenue | prev_revenue | yoy_pct |
|---|---|---|---|
| 2023 | 100 | null | null |
| 2024 | 150 | 100 | 50 |
orders| amount | order_id | ordered_at |
|---|---|---|
| 25 | 1 | 2024-05-01T00:00:00Z |
| year | revenue | prev_revenue | yoy_pct |
|---|---|---|---|
| 2024 | 25 | null | null |
Community-reported interview topic. Not an official company question and no affiliation is implied.
Run against the public tests, or submit to score against all of them.