Aviva Canada interview question

Check the equivalence or two random string.