Swrve interview question

Given two arrays get common elements and return them in an array.