You will never get a job like that by repeating an answer you were given on a site like this. You need to learn how to answer that question in your words using your experience and examples that you have actually been part of. That said, you can find a better answer to give them next time. They key is to understand why they are asking. They believe they know what to do and not to do in that situation, and they want to see if you do too.
A good answer will contain two things. First, you should easily be able to list your options: telling the client the deadline will not be met, dropping some part of the work, those sorts of things. And this list should not include things that won't work, like adding people to the project. Second, you should be able to explain how you would choose among those options and how you would communicate in the situation. If you just say "I would X" without any explanations of why X instead of Y, it's not a good answer.
If you're applying for a project management position, they will expect somewhat different options and thought processes than if you're applying as a developer working without the support of PM, but the basic "I would have a choice of X or Y, I wouldn't consider A or B, and I would choose X or Y based on Z" will still be there.
If you don't have a good answer for this and have been asked it more than once, get yourself a good answer. Surely you have faced this? Even if you saw someone else handle it rather than handling it yourself? What worked, what didn't, what have you done in that situation before? Get better at telling that story.
This is also an opportunity, after answering the question, to talk about how important it is not to get into that situation, and what you do to prevent it. This might be regular status meetings, frequent releases, resisting scope creep, monitoring progress, or any number of other techniques you have learned in your job. The interviewer wants to know what you know how to do.