Amazon Interview Question

How to efficiently compare a strings