Cisco Interview Question

How to compare two string effectively.(o(n))