With over 1 million daily active users and over 2.5 million advertisers, Facebook runs one of the world’s largest online advertising marketplaces. Advertisers can choose to bid and pay for ad impressions, for clicks, for conversions or for a combination. The ranking and pricing of ads depends on the predicted probability of clicks and conversions. In this talk we give a brief overview of the algorithmic problems underlying the Facebook ads auction. We share some lessons learnt from building the scalable machine learning platform we use to tackle the prediction problem, and discuss challenges in optimization and mechanism design.