logoalt Hacker News

ta93754829today at 1:37 AM4 repliesview on HN

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


Replies

Trastertoday at 12:11 PM

I'm not certain the point of an interview is to ask you to write the exact lines of code that you would write during the job.

oreallytoday at 8:54 AM

Psychologists have been saying for ages that a good job interview is a small version of what the job requires them to do. But as always with most professions with people (and hence ego) involved, these people either mimic what the trending company in their sector does or test irrelevant academia knowledge.

Maybe for such changes to happen the whole profession to go down a notch in prestige. Not sure if people can stomach that.

Induanetoday at 1:53 AM

One interview question I like that's simpler and more applicable is to code a function that outputs the frequency count of each word in a string of text. Bonus for outputting the count in most to least order.

show 1 reply
AdieuToLogictoday at 2:23 AM

> ... 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

A binary search[0] of a sorted collection requires the median of each region being considered for each iteration.

0 - https://en.wikipedia.org/wiki/Binary_search

show 1 reply