ThoughtSpot interview question

Top k frequent elements in a int array