I would have actually called that out. Don't let this stuff go unchecked. I know as students/residents we're at the bottom of the food chain but racism should never be tolerated in any context. You don't have to be intimidating about it either. I know it's harder in the actual position of someone who had this said to them. What I would have recommended saying was "sir, I don't appreciate the humor in that...you may very well have not meant it to be, but your statement was hurful to me". I would personally leave it for the end so that it doesn't disrupt the flow of the interview. Try not to accuse him/her of being anything, just state what he/she said and explain why you felt it was hurtful.
I used to be of the mentality to just ignore such things and just try to do my job but after an experience in residency, I changed my mind. I was admitting a frequent flier often admitted for missed dialysis and he was in for the same thing. He claimed we had messed up his BP medications (discharged with on his previous visit) and would not allow me to get a proper history without cursing and I told him that was not appropriate language for the hospital to which he responded "go back to your ^&(&*^ country" and would not back down. I excused myself to de-escalate the situation and had my intern finish the history. I mentioned it to my attending in passing and he was upset about it too so we discussed it with the nurse manager who said she would report it up the chain. I chart reviewed the patient and searched "yelled" and found 5 hits spanning from 2002 to then with several accounts of him abusing nurses verbally, using xenophobic/homophobic language. Me reporting this may or may not have done anything ultimately, but we need to do our best to confront these sort of things because if it happens to you, it's likely going to happen to someone else too.