There are several structural characteristics of "The Open Window" that help create a feeling of surprise. One of them is how the author manipulates time. In order to do so, he uses flashbacks extensively. The best example is when Mr. Nuttel thinks of the words his sister said to him when he was about to go to the countryside. Through this flashback, we also learn that Mr. Nuttel has problems with his nerves.
The author also surprises us by not placing all the characters together at the same time. The fact that the aunt is upstairs and her husband is out allow for the surprise at the end to materialize.
Finally, the author builds the story with the expectation of a surprise, created through foreshadowing. However, he does not reveal what the surprise is until the very end, when it becomes inevitable.