Zuckerberg was already a great programmer before Facebook, and had a number of successful projects under his belt. Facebook also took years to build, its growth was not anything like what Pinterest has been experiencing.
Mark (along with D'Angelo) developed Synapse (a media player) in high-school that learned what you listened to and created a playlist. They were being offered $1million to $2million for it.