Domanda di colloquio di Google

The first question is string manipulation. The second is graph.