The Determine if Two Events Have Conflict interview question provides two time intervals, each represented as [startTime, endTime] in "HH:MM" format. You need to return true if the events overlap at any point (including touching at the same minute).
Goldman Sachs and Google use this to test your ability to handle non-standard numeric formats. It evaluations how you approach interval comparison and whether you can transform strings into a comparable format (like total minutes from midnight). It’s a basic test of "Overlap Logic" found in calendar and scheduling applications.
The problem uses Interval Comparison. Two intervals [a, b] and [c, d] conflict if a <= d and c <= b.
The most robust way to handle the "HH:MM" format is to compare the strings directly (since they are zero-padded and fixed length) or convert them to integers representing the total minutes since the start of the day.
Event 1: ["01:15", "02:00"], Event 2: ["02:00", "03:00"].
true.
Event 1: ["10:00", "11:00"], Event 2: ["14:00", "15:00"].false.a < c < b instead of the more general start1 <= end2 && start2 <= end1.For "HH:MM" format problems, string comparison works perfectly because "10:30" is lexicographically greater than "09:45". You don't even need to convert to minutes unless you need to calculate the duration.