I suppose I'm a little late for thinking of this, but on my 3 billionth viewing of FOTR, I started to wonder:

When exactly does Gollum find and start tracking the fellowship? I wonder this because when Frodo sees him for the first time Gandalf says he's been following them for three days. Yet I don't think that he could have found them west of the Misty Mountains considering the entrance to Moria collapsed after the Fellowship entered.

Did Gollum come from Moria and just hang out in the Misty Mountains and hoped he'd bump into someone?

I know there are plenty of people that'd know more about this than I would. And as always, I'm sorry if this has been talked about already, but I didn't see anything when I did a search.

Quietly, now. It's a four day journey to the other side. Let us hope that our presence will go unnoticed.

As you say, while Frodo and Gandalf are talking, Gandalf again says:

Quote

He's been following us for three days

So this strongly implies that Gollum started following the Fellowship either inside Moria or just before their passing through the gates. In the FOTR book, Frodo hears footsteps behind the Company just hours after the Fellowship enter the Mines. In both instances (book and film), it was pretty much as they entered through the West Gate.

You can find more detail of how Gollum found his way into the Mountains in the Appendices and The Hunt for the Ring in the Unfinished Tales.

From the UT:

Quote

What then happened to Gollum cannot of course be known for certain. He was peculiarly fitted to survive in such straits, though at the cost of great misery; but he was in great peril of discovery by the servant of Sauron that lurked in Moria, especially since such bare necessity of food as he must have he could only get by thieving dangerously. ... he became lost, and it was a very long time before he found his way about. It thus seems probable that he had not long made his way toward the West-Gate when the Nine Walkers arrived. He knew nothing, of course, about the action of the doors. To him they would seem huge and immovable; and though they had no lock or bar and opened outwards to a thrust, he did not discover that. In any case, he was now far away from any source of food, for the Orcs were mostly in the East End of Moria, and was become weak and desperate, so that even if he had known all about the doors he still could not have thrust them open. It was thus a piece of singular good fortune for Gollum that the Nine Walkers arrived when they did.