I've always felt that while people think of confidence as something that's largely external in terms of how people view a person, it really starts internally. In times of self doubt I always have a few examples of times I've done something well or achieved something stored in my head to give me a bit of a lift. Even the most confident people will go through these little dips.
Also, it's worth mentioning that, while failing sucks, you should think of it as a positive. I've failed plenty of times so far, exams, interviews, jobs etc. Its a learning curve. I hate this phrase but it kind of works: Everyday's a school day.