

This task is not that complicated. You have a list of timestamps with the seconds and the number of interactions for that second. All you need to do is to find the seconds with the most interactions. On a 1h video this would be only 3600 calculations “if currentValue is greater than maxValue”. If you store it as a Plain integer array you would need ~14KB of RAM. For comparison, a 1987 homecomputer with a 68000 CPU would do ~7Million calculations per second and have ~512kB of RAM, depending on the options.
In highrises with lots of stops and users, it uses some more advanced software to schedule the optimal stops, or distribute the load between multiple lifts. A similar concept exists for HDD controllers, where the read write arm must move to different positions to load data stored on different plates and sectors, and Repositioning the head is a slow and expensive process that cuts down the data transfer rate.