Can you tell me which one is correct:

1. "Did you had a chance to look at. . ."

2."Did you have a chance to look at. . ."

I assume it is #2 because after did the verb has to be in infinitive. Is that correct?

Also does that mean that I should always write:

Did he have a snack? (as oppose to "Did he has a snack?")

I'm genuinely confused about how Have/Has/Had function when used after Did?

You are correct. After auxiliary DO (do, does, did), only the bare infinitive is used.
Site Hint: Check out our list of pronunciation videos.

Did you had a look

"Did you had a look" is incorrect.

Yes its incorrect

It will -did you have a loo?

Students: We have free audio pronunciation exercises.