Take-home: given a JSON file of events (title, start time, end time), build a simple app that lists the events sorted by start time and marks which events conflict in time with others; explain the algorithm choice and time/space complexity. Due in 3 days.
Asked in the take-home project stage. Offered as an alternative to the algorithm phone screen; followed by a call with a Facebook engineer to discuss the approach.
Implement def mark_conflicting_events(events):. Each event is a dictionary with string fields title, start_time, and end_time, using ISO 8601 timestamps. Return copied event dictionaries sorted by start_time, adding boolean conflicts. Two events conflict when one starts before the other ends. Events touching at an endpoint do not conflict.
Example: [A 09:00-10:00, B 09:30-11:00] returns both with conflicts: true. Non-overlapping events return false.
def mark_conflicting_events(events):