“Yes, sir” or “Yes, ma'am” or “Certainly” seem to me as among the few appropriate responses possible if the examiner is performing a solemn and official required duty.
Replies like “Not at all”, “Don’t mention it”, “No problem”, and “Anytime” make light of the examiner's duty.
“Thank you”, although often suitable as a response to someone just doing their job properly, seems servile in this case. “You’re welcome” runs the risk of seeming insincere as a response to the affront or bother of having one's identification checked.
Do the needful is Indian English, which has been covered on ELU.
If you're only interacting with other speakers of Indian English then feel free to use it, but avoid it in any other contexts (most Americans and Brits will think it's quaint/uneducated).
In general, the "standard" form is do what[ever] is necessary, but in OP's specific context most likely nothing like that would be used anyway. If you've just asked for an email address, it goes without saying that you want the other person to do whatever is necessary to give you that information.
I may be wrong, but I have the impression that for many Indian English speakers, "Please do the needful" carries a subtext of "This problem is too complex for me to understand or resolve myself, but I have complete faith that you will be able to deal with it, because you are very skilled in such matters"
As I said, Brits and Americans wouldn't normally use any equivalent for such a trivial problem as finding someone's email address. But if the request was for something more challenging (and crucially, if it was from a manager to a more junior worker), "Do what[ever] [you think] is necessary [to solve this problem]" might be perfectly normal. The implication there is that the manager is authorising the junior to do things he might otherwise not be "permitted" to do (in effect, the junior is being temporarily "promoted" for the duration of the problem-solving).
In that context, it should be clear that (to Americans or Brits, at least) any such phrase would probably be considered offensive/cheeky if addressed to an equal in the workplace (if the person asking isn't senior enough to confer temporary authority on you, they shouldn't be speaking to you that way).
Best Answer
The locution "of course" is neither polite nor impolite. The tone in which it is delivered makes all the difference.