Interview Guides
You are given Waymo Driver state-change logs and trip boundaries. Write a PostgreSQL query to calculate, for each trip, the total time the vehicle spent in autonomous mode versus manual mode. Treat each state row as effective until the next state change within the same trip; for the final state in a trip, use the trip end time. Ignore rows where the state is NULL.