Loading...

The Hourly Bucket

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

Write a function that groups events by the hour they occurred. Each event is a dict with 'ts' (ISO timestamp like 'YYYY-MM-DDTHH:MM:SS') and 'type'. Return a dict mapping the hour prefix 'YYYY-MM-DDTHH' to a list of event type strings in original order.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.