You've probably been there. Interview after interview after take-home test after pair-programming session to only get a vague templated email rejection without any real info on why you got turned down.
How do you deal with it?
I personally find it increasingly difficult to be polite about it - especially as I grow older.
Afterward, I take the time to mourn and process the rejection. It sucks and that's very human. I've been rejected more times than I can count, and at times, I was overly confident that a job was going to be mine during the interviews.
I've learned to keep going and put myself out there over and over regardless of what happens. I'm doing this right now for a job that's really calling me, like one of those 'I don't want to wake up at 60 with regret if I don't at least try.' You miss 100% of the shots you don't take.