Given fact_trip (trip details, driver_id, rider_id, start_time, end_time, city_id) and driver_signup (driver_id, signup_date), find driver_ids who have not taken a trip in the first 7 days of their signup. Discuss optimizations based on data volume.
Asked in the Round 1 stage. Implement this with Python lists of dictionaries. driver_signup contains driver_id and signup_date; fact_trip contains the listed trip fields. Treat a trip as qualifying when its start_time is on or after signup and before signup plus 7 days. Return qualifying driver IDs in ascending order.
def drivers_without_first_week_trip(driver_signup, fact_trip):