Merkle Interview Question

How do search engines rank ads?