I have received an excellent job offer from institution A. I have also applied to institution B, which I would likely prefer over A if I had the choice. I believe I have a shot at getting an offer from B, but it is far from sure, and they will only start making offers well after I have to give an answer at A.
Suppose I accept the job at A and subsequently I am offered the job at B. Once I accept A I would commit to staying for at least 1 year, but starting one year later at B should not be a problem.
My question is: how and, more importantly, when should I tell A about B? I can think of three possibilities:
1) I tell A even before I accept the position at A (and before I get the answer from B). I believe in honesty so I would prefer this but there are the obvious risks that A will withdraw their offer or assume that I will leave at the first chance I get (which is not quite true; if I don't get B I'd stay at A for at least a few years).
2) I tell A right after I accept the position at B (this would mean I would start my job at A with everyone knowing that I'm leaving after a year - awkward).
3) I tell A at the very latest legally allowed moment. This would seem best from a selfish point of view, but in addition to having to lie about my future plans there is a risk A will find out I accepted the job from B anyway (it's a small community).
Any additional thoughts are very welcome! In particular, how would you react in each scenario if you were a member of A?
Edit: Thank you all for the comments and answers. In my situation A is not able to wait until I get an answer from B; I agree this would be the best solution. Although I haven't made a decision yet, I'm leaning towards avoiding all the scenarios in the question and either accept A and withdraw my application from B, or reject A, wait for B, and keep applying next year if I don't get B.