Back to problems

Find Kth Largest and Tree Ancestors

Algorithm · Meta · Medium

In one technical phone screen, an interviewer posed two algorithmic coding tasks and then pushed on several follow-up variations of the second one. For every task, be ready to explain the central idea, the edge cases worth checking, and the implementation you would actually write under interview pressure. Task 1: Selecting the $$k$$-th largest value You receive an array of integers nums whose elements are in no particular order, plus an integer k. Report the element that…

Checking your access…