Truecaller interview question

A hamiltonian path problem.