X interview question

Write a Digg-like algorithm