How does Stack Overflow handle spam?
new user limits (only 1 url allowed in posts, only 1 question per 20 minutes, only 1 answer per 3 minutes)
script detection heuristics and "honeypots"
user flagging (spam / offensive / moderator attention)
auto-removal of some items based on certain flag thresholds being met
active moderator participation throughout the day to look at moderator flagged items
There are also the moderators in place, who can delete posts that are deemed as spam, and the community, who are the ones who flag posts as spam to get the moderators' attention.