Back to problems

Compute browsing metrics in Python from logs

Algorithm · Airbnb · Hard

You are handed two UTC-stamped tables for an e-commerce site: events(event_id, ts_utc, guest_id, device, traffic_source, event_type, page_url, user_agent) and guests(guest_id, signup_dt_utc). device is one of desktop / mobile; traffic_source is one of direct, seo, sem, email, partner; event_type is one of page_view, add_to_cart, checkout_start, order_completed. Every stored timestamp is already UTC — never shift it, and derive every boundary below in UTC so results are…

Checking your access…