You did your prep, you were well presented, you answered all the questions. Congrats, you nailed the interview! That’s great, it’s a hard thing to do. You should be delighted, even if you don’t end up getting the offer.
Either you will get the offer, or you won’t. If the offer doesn’t come your way, that’s the way the cookie crumbles. You did your best, you couldn’t have done more. Here are the four reasons you didn’t get the job.
1) It was already someone else’s. The company was going through the motions or through the necessary compliance process of looking at a couple of other candidates. In fairness, you could have tried to find this out during the interview. There’s nothing cheeky in asking about the other candidates so that you can sell against them.
2) Someone else better than you got the job. Don’t beat yourself up, you did your best and it took a truly exceptional candidate to edge you out. As the Desiderata says, there’s no point comparing yourself to others. There will always better and lesser folk than you. The important thing is that you did your best.
3) You wouldn’t fit in. This is a blessing in disguise and the company is doing you a favour. If the cultural fit wasn’t right for you, you would have been miserable in the job.
4) There was no job. The company was having a look around, or decided not to appoint a candidate. These are the worst types of companies. They’re true time-wasters and your time is valuable so you’re better off where you are.