How do you answer an interview question like this? “What happens if you get a better offer within the period of your employment with us?”

I would discuss with my manager why I think the incoming offer looks like a better option for me and then see if there is something we could do that makes sense for both me and the company to help me choose to stay.

Honestly, when you’re being interviewed, don’t try to BS. When I’m hiring, I’m going to be smelling for BS from 100 miles out. Every employer-employee relationship is contractual and any employer that is worth your time working for should understand that you need to get something out of working for them. I would recommend saying something along these lines:

“I cannot provide a guarantee that I will stay forever but I can tell you that when I join a company I won’t consider leaving unless leaving is the better option for me and my family. And, if I ever do consider leaving because of another offer, I would discuss with my manager why I think the incoming offer looks like a better option for me and then see if there is something we could do that makes sense for both me and the company to help me choose to stay. I fully recognize that there may be times when it makes the most sense for us to end our relationship as employee/employer but I will always default to having an open conversation before leaving. Also, I don’t look just at the salary when making a decision on an offer. What I am mostly looking for is whether I am being fairly compensated for my contributions and whether the company supports my career objectives.”