You are given a log of status events for pages. Each row records a page turning on or off at a timestamp. A page is currently active if its most recent event has a status of 'on'. Return the total number of currently active pages.
What this question tests
Tests reducing an event log to current state: isolating the most recent event per page before counting. Log-to-state is everywhere in product data; interviewers accept several routes (window functions, a correlated subquery, a self-join) as long as ordering is handled deliberately.