Answer:
foreshadowing and flashback.
Step-by-step explanation:
Foreshadowing and Flashback was used in The Boarded Window to create the surprise ending as the readers were not aware of some details until the last minute which made the ending more surprising.
Foreshadowing is a technique that is used to show what would happen in future, while Flashback is used to show whet happened in the past.