How to buy plane tickets for job interviews?
I am writing to disagree with Charles Morisset's answer. (I signed up just now, and am unable to comment.) At least, I would consider part of his answer to be poor advice for applying to TT jobs in mathematics.

In particular, I believe you should always accept invitations to interview if you think they're in your best interest -- i.e., if you would be happy to take a job there, and if you are not absolutely confident you won't get better offers.

Suppose that I had scheduled an interview at A, and I get an interview offer from B. I prefer A to B, but I also really like B. Then I would definitely accept the interview offer at B, even if you might get an offer from A in the meantime.

I say this as someone who was on our hiring committee this year. It is a difficult and stressful process for us, but surely it is much more difficult and stressful for candidates. We understand that candidates want to get the best job possible and expect that they will look out for their own best interests. We expect honesty, but hesitating to accept an interview offer at a school you like, under almost any circumstances, seems unwise to me.

What if you accept an offer from A before your interview at B, and the plane ticket is bought? I would contact B, tell them you had accepted another offer, offer thanks and apologies, and offer either to come and give your lecture, or to simply cancel the trip. Most hiring committees, I think, would be gracious and kind, would ask you not to come, and would refund your plane ticket. Perhaps they would like to meet you anyway, and give you the option of giving your talk. In the unlikely event that they are rude, this will give you reason to be grateful that you will be working elsewhere.