Google interview question

Implement a topological sort algorithm.