For some reason, I think of jumpscares in horror video games. When you think about the logistics of setting up an ambush it's hard not to believe that the ghost or killer needs to put a bit of pre-planning into their stalking to make it work realistically. Knowing things like where to hide to escape line of sight, or when to dive under the bed to prepare to grab the protag's hand when they reach down later has to take time.
Of course, you can always play the wildcard, aka "magic", and end it there. Personally, I prefer this headcannon where all ghosts in horror stories are actually this well coordinated, and in the background there is a tremendous amount of intel gathering that we have no idea goes on. Like a bunch of kids pulling a prank.