Larsen & Toubro interview question

Find the most frequently occurring element in an array. If multiple elements have the same highest frequency, return the smallest element.