Pandas interview question: UTC timestamps to local dates

EasyTime zones

Problem

Shared data rules

The dashboard dates orders in UTC, but Finance uses its own time zone. For each finance date Sep 1–27, 2026, count delivered orders. Also find the share of them that the dashboard puts on another date.

Example

Input: orders
order_idstatuscreated_atRow note
101delivered2026-09-10 15:00
102delivered2026-09-11 01:30← 21:30 in New York — Sep 10
103delivered2026-09-11 04:10← 00:10 in New York — Sep 11
104delivered2026-09-11 18:00
105delivered2026-09-12 02:00← 22:00 in New York — Sep 11
Output
finance_dateordersshifted_ordersshifted_share
2026-09-10210.5
2026-09-11310.3333

Finance’s Sep 10 has orders 101 and 102, and the dashboard puts 102 on Sep 11. Sep 11 has orders 103–105, and 105 lands on Sep 12.

Output columns

shifted_orders
how many of them the dashboard puts on another date

Notes

Solve it free

Your code runs on real pandas in your browser. No sign-up needed.

Skills it tests

More interview questions

All questions