Panda Guru LogoPanda
Guru

Does Meta expect quick select for onsite? (E3, new grad, US)

Round 1

Questions: Specific question not provided.
The interviewer instructed the candidate to "use the most efficient solution you can think of."

Candidate's Approach

The candidate explained three possible approaches to the problem:

  1. Brute force with sorting: Time complexity: O(nlogn), Space complexity: O(n)
  2. Heap: Time complexity: O(nlogk), Space complexity: O(k)
  3. Quick select: Average time complexity: O(n), Worst case: O(n^2), Space complexity: O(n) (can be optimized to O(1))

The candidate suggested that quick select would be the best average solution but expressed concerns about the time required for a dry run. The interviewer then encouraged the candidate to implement the heap solution instead. In the last two minutes, the candidate explained how quick select works and provided pseudocode for it.

Interviewer's Feedback

The interviewer acknowledged the candidate's explanation of quick select and indicated that they understood it, suggesting that the candidate did not need to explain further. However, the candidate felt that this might have been a way for the interviewer to allow time for questions about Meta.