Amazon Interview Question

One question was about finding sub-strings, can't give much more information about it though.