Gollum starts following the Fellowship soon after they enter Moria. Frodo hears his faint footsteps throughout their journey to Balin's tomb in the Hall of Records. But how could Gollum follow them out of Moria?
From FotR, I gather that the situation looks like this:
In the Hall of Records, the orcs attack, and the fellowship flees through a small passage. Gandalf blocks the way by collapsing the door. So Gollum could not follow them on this way (without the Ring, it seems very unlikely that he somehow slipped past all the orcs and Gandalf and was not noticed by any of the Fellowship).
The "main" way through the great hall was blocked by a large crack filled with fire. The company realizes that it was made by the orcs to block the way to the great gate/east entrance and that they were lucky to have been forced to take the other way. Only after trolls put down large blocks of rock the orcs are able to pass the crack. Again, with all the orcs it seems unlikely that Gollum slipped through.
The last bridge was made very narrow by the Dwarves so that an invading enemy had to pass it in single file, making it easy to defend for the Dwarves on the other side. This implies that it was the only passage out of Moria to the east gate. Since it was destroyed by Gandalf, Gollum could not pass it.
So how did Gollum manage to get out of Moria, quickly enough for him to not loose track of the Fellowship? How did he find a way out while avoiding all those orcs and trolls? How could such a way even exist?