Scheduling is NP-Hard. We need responses in milliseconds
cal.com
cal.com
I have a practical writeup here as well that demonstrates pulling multiple calendars, building an interval tree, and then checking for overlaps/finding free slots [1]. It is possible to modify the algorithm so that the free slots are also tracked so no iteration is required to detect conflicts (trading space for time).
There are some other algorithms for bin-packing (calendar scheduling over a closed interval is just a bin-packing problem) that can also be used for this type of solving. Google OR-Tools, for example [2].
However, my sense is that interval trees or bin-packing solvers are what teams building schedulers really want, but teams building schedulers usually start with simple. Hope the Cal.com team sees this and gives it a go!
[0] https://en.wikipedia.org/wiki/Interval_tree
[1] https://chrlschn.dev/blog/2022/11/concurrent-processing-dotn...