Meta interview question

heap(kth element in the array) and queue(valid parentheses)