The preposition changes the meaning

passer

parno preposition

The constructions

parpasser par + un lieu

Meaning : the way you go through

Nous passerons par Lyon.

pourpasser pour quelqu'un

Meaning : to be taken for

Il passe pour un expert.

no prepositionpasser quelque chose

Meaning : an exam, time, an object

J'ai passé mon examen hier.

Do not writeJ'ai passé par mon examen hier.

Why

Passer par gives the route: passer par Lyon, passer par la fenêtre. Passer pour gives the appearance: passer pour un génie. Passer quelque chose, direct, covers passer un examen, passer une heure, passer le sel. And passer un examen means to sit it, not to pass it.

The trap for a Chinese speaker

考試 and 通過考試 are two different things. Passer un examen is only to sit it; to say you got it, it is réussir un examen.

The preposition changes the meaning