Earliest Common Meeting Start
Reported by candidates from Visa's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The edge case that breaks a naive solution here is the inclusive end time, and Visa's October 2026 OA report makes it the whole problem. Busy rows cover start through end, so a meeting can't begin at 10:00 if someone's busy until 10:00. It has to begin at 10:01. Add the odd rule that the search starts at the earliest listed start, not midnight, and plenty of candidates will lose points on the examples alone. It's a greedy merge-intervals problem in disguise. If you blank during the live assessment, StealthCoder is the invisible safety net on your desktop.
The problem
Each row of busy is [person, activity, start, end], where the times use 24-hour HH:MM format. A row makes its person unavailable at every minute from start through end, inclusive. Return the earliest time at which all listed people can attend for duration consecutive minute slots within the same day. When at least one busy row is present, search begins at the earliest listed start time; an empty calendar begins at 00:00. Overlapping intervals are combined. Return the start as HH:MM, or -1 when no meeting fits. Function earliestCommonMeetingStart(busy: String[][], duration: int) → String Examples Example 1 busy = [["A","focus","02:00","10:00"],["B","lunch","12:00","12:59"]] duration = 180 return = "13:00" Minute 13:00 begins the first three-hour span after both inclusive busy intervals. Example 2 busy = [["A","focus","02:00","10:00"],["B","lunch","12:00","12:59"]] duration = 90 return = "10:01" The first busy interval ends at 10:00 inclusive, so the earliest ninety-minute meeting begins at 10:01. Constraints 0 <= busy.length <= 10000. Every row has four strings; start and end are valid same-day times with start no later than end. 1 <= duration <= 1440.
Reported by candidates. Source: FastPrep
Pattern and pitfall
Convert every HH:MM to minutes since midnight. Sort all busy rows by start, ignoring who they belong to, because the meeting needs everyone free. Merge overlapping intervals. Since both ends are inclusive, treat intervals as closed minute ranges. Then sweep: set a cursor at the earliest start (or 0 if the list is empty). For each merged interval, if interval.start - cursor >= duration, return the cursor. Otherwise move the cursor to interval.end + 1. After the loop, check that cursor + duration - 1 <= 1439, and format back to HH:MM with zero padding. Pitfalls: off-by-one on inclusive ends, merging adjacent intervals like 10:00-10:59 and 11:00-11:30 (they leave no gap), and forgetting the end-of-day bound. Sorting 10000 rows is cheap. If the sweep logic slips under pressure, StealthCoder can give you the clean version in the live OA.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Earliest Common Meeting Start cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Visa's OA.
Visa reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Earliest Common Meeting Start FAQ
What's the trick in the Visa Earliest Common Meeting Start problem?+
Flatten all busy rows into minute intervals, sort, merge, then sweep for the first gap of at least duration minutes. The people don't matter since everyone must be free. The real trick is treating end times as inclusive, so the next free minute is end + 1.
Why does Example 2 return 10:01 and not 10:00?+
Busy intervals include their end minute. Person A is busy at 10:00, so the earliest free minute is 10:01. A 90-minute meeting from 10:01 ends at 11:30, before B's lunch at 12:00, so it fits.
Where does the search start when busy is empty?+
At 00:00. With at least one row, the search begins at the earliest listed start time, not midnight. That's why Example 1 never considers 00:00 even though it's technically free. Handle the empty case separately and return 00:00 when duration fits in the day.
What edge cases should I test before submitting?+
Test an empty calendar, adjacent intervals with no gap, a single interval, a gap of exactly duration minutes, and a meeting that would run past 23:59. Also test fully overlapping intervals and duration 1440. Each one hits a different off-by-one.
How do I prepare for this in 48 hours?+
Write merge intervals from memory, then add the sweep for gaps. Practice minute conversion and zero-padded formatting. Run both examples by hand. If you've done LeetCode merge-intervals style problems, the only new parts are the inclusive ends and the start rule.