Yes, I thought about both possibilities (discrimination and insecurity) but I want to remain positive and not attribute ulterior motives to the interviewer. It was an ironic experience though because, I believe, had my code been a bit slower I would have had a better shot at the interview.
Or the interviewer felt insecure and threatened by their competence. If that's the case, they dodged a bullet.