ThoughtSpot Interview Question

Top k frequent elements in a int array