It's randomly generated for each level trainer which interacts with the pokemon with an even distribution between level 1 and the level of the trainer, up to level 30.
So at level 35 you have an equal chance of running into a pokemon of level 1 or level 30, or any other level in between.
That said, once the level of the pokemon has been determined for a particular level trainer (let's say you try to catch a pokemon in the wild and it turns out to be level 25), it will remain a level 25 pokemon for any other trainers of your level which interact with it before it despawns.
Of course, the same holds true if someone else at level 35 interacts with it before you do. Whatever level it is for them will be the same as it is for you in that case.
It's sort of Schrödinger's Theory of pokemon levels. :D