Min-heap on end times is the standard calendar concurrency question.
Enable JavaScript for the full StreamPrep guide.