logoalt Hacker News

kccqzytoday at 2:22 AM1 replyview on HN

After the candidate has finished this, you could then ask them to compute the weighted median. Chances are, the candidate has never heard of this term and yet the term is simple enough that without prior knowledge they can use their intuition to give a definition for this term and implement it. Good candidates can define and implement it for weights that are natural numbers, and better candidates can implement it for any weights that are nonnegative.

Candidates who could implement an O(n) median algorithm but chose to implement an O(n log n) weighted median algorithm might be someone who rote remembered the O(n) algorithm. Truly excellent strong hires can adapt their O(n) algorithm to weighted median too.


Replies

bulbartoday at 4:42 AM

How do you know they didn't just have heard about weighed median before and how to implement it?

Or did just more grinding on leetcode in general.

I am not convinced that what you call "strong" can be tested by something like that.

show 1 reply