Apple Interview Question

I was given a direct coding question about how I would determine whether two patterns given to me were correct.