Tiktok | Round 1 (Lark) | Valid Meetings

I recently had a Tiktok Lark interview for 2025 Fresh grad roles. And I got stomped by the question. The question (I thought) seemed similar to merging intervals and meeting rooms 1 from leetcode but it seems not.

The questions is:

Given a non-sorted array of meetings with start time and end time (start time inclusive, endtime not inclusive), return an array of boolean where True means the current meeting at index i does not overlap with any other prior meetings at index j (where j < i) and False means there's an overlapping meeting at some index j < i.

For example:
[(1,2), (2,3), (5,10), (2,4)] should return [ True, True, True, False].
[(1, 10), (2,5), (6,7)] should return [True, False, False]
[(1,2), (2,4), (5,10), (4,5), (1,4)] should return [True, True, True, True, False]

My initial idea is to sort the intervals (after mapping the interval to the original index) then compare the cur element with previous and next elements. But that approach wouldn't work if an earlier element had a large ending time.
My interviewer suggested using BST but i wasn't sure about the exact algorithm I should use.

Is there any similar leet-code question to this kind of problem? And what algorithm should I use exactly?

Comments (2)