8 comments

  • ta93754829 3 minutes ago

    I don't know... I've been coding for ~30 years, and I've never had to write code to compute the median so it doesn't seem that useful unless it's somehow relevant to the job

  • apricot 22 minutes ago

    In addition to the points listed, it gives the algorithm nerds the opportunity to show their overqualification by whipping out the O(n) median algorithm and proving that it works in linear time.

      salamanderman 17 minutes ago

      I almost tanked an interview, and luckily turned it around, when the interviewer had never heard of QuickSelect and thought I was insane when I started writing it.

  • wewewedxfgdf 15 minutes ago

    Great question! Assuming the job requires calculating a lot of medians.

  • floxy 11 minutes ago
  • joshdavham 20 minutes ago

    I also like this question.

    A fun follow up is asking a candidate how to compute the 25th and 75th percentiles or more broadly, the n-th percentile.

  • ukoki 18 minutes ago

    Only the median (or pair around the median) needs to be sorted, the other numbers can be unsorted :)

  • jagged-chisel 12 minutes ago

    > High-quality candidates …

    Oh, you … ;-)