There was at least one foreshadowing event, at least two significant clues, and other significant indicators.
We see foreshadowing on how the Night King was going to die when Arya Stark duels (trains with) Brienne of Tarth. Please see this clip of the duel/training.
Now please see this clip of the Night King’s demise.
The two are identical in the sense that Arya’s opponents both fall for the knife-is-in-the-other-hand trick. The only thing that prevents us from saying “If we dressed Brienne in Night King clothes we would have the conclusion of the series” is that Brienne had a sword and Arya used the other hand.
Arya developed the highly valuable habit of going straight for the jugular, planning in advance to make that possible. She did precisely that with the Knight King, though much of it was in haste and occurred off camera. Here are two examples of going for the jugular.
I’m going to kill the Queen. Arya’s intention to go for the jugular (though no apparent plan yet) is when Arya stated out loud while addressing others that she was going to kill the Queen (Cersei Lannister).
Please understand that Arya was not joking – at all. She laughed with the others because she saw the humor in the irony as well as anybody else.
Another clue is the demise of Walder Frey and his House. Arya would make sure that “Winter came for House Frey”. And she went for the jugular, stopping only to gather props (Black Walder’s and Lothar’s deaths are the equivalent of having to go through the skin to get to the jugular).
Her elaborate plan only concluded when House Frey was no more.
Her plan was very dangerous, and complex to the point where crucial events needed to come together in sequence. Important to note here is that she alone planned it, she alone executed it, and perhaps most importantly, she alone accepted and bore the high order risk of failure and death.
There are indicators that Arya has a significant role to play, and has developed the skills to make it happen.
Arya masters movement in complete darkness.
We learn here that Arya bested a worthy opponent by using complete darkness. We also see that it at least only partially appeared that the she was running in a panic. To our surprise, we see that Arya had a backup plan to come out on top.
Jaqen H’ghar prepares Arya and finally sends her on her way. Please note Jaqen’s subtle smile and nod just before Arya leaves (and just after she says “A girl is Arya Stark of Winterfell, and I’m going home.”).
It’s reasonable to think that Jaqen would have killed Arya had she violated his sanctuary so badly. The smile/nod, and that Arya doesn’t mysteriously die, indicates that Jaqen has a plan that she was now ready to act on. It makes you wonder whether Jaqen planned all of Arya’s “punishments” to train her for her now-revived intentions.