The answer is "It depends".
It depends on a number of factors
- How desperate they are for staff
- How good the other candidates are
- How good you are on paper compared to the other candidates
If a candidate truly impresses before you have your interview, then they could easily be hired almost there and then. I have had it when before I had even gotten home I had a voicemail with a job offer.
If they aren't in as such a rush for the appointment then generally you will get time. Remember youy'll have a notice period too, so an extra couple of weeks isn't that much really, unless they are desperate for staff.
From the comment:
From your experience, does it happen very often where companies hire somebody before the process hasn't completed? 2 weeks just doesn't seem like a long time imo.
This depends on so many factors.
Lets say John is interviewed today. He's absolutely nailed the interview and everyone is left really impressed. Your interview is in 2 weeks.
Next week, however, John calls the company and says "Hey, I have a job offer from another company. I am in a position where I would accept that offer, but was wondering if you guys would be looking to make an offer too as i'm really keen to work for you".
Now the company have a decision to make. Do they wait another week for you (potentially losing the chance to hire John), or do they make an offer to get John (as if this doesn't work, you are still scheduled to be interviewed)?
There isn't a definitive answer to this, it purely depends on the people making the decision.
I have been involved in processes where I was interviewed first and given a job offer 30 mins after the interview, I have also been the last interviewed and got roles. I haven't yet had a situation where an interview was cancelled as they hired someone else, but this is all personal experience.