I was a mathematician, and now work in finance (systematic trading). I've found a reasonable negative filter is A jar has 1000 coins, of which 999 are fair and 1 is double headed. Pick a coin at random, and toss it 10 times. Given that you see 10 heads, what is the probability that the next toss of that coin is also a head? That tests their ability to turn a problem into mathematics, and some very basic conditional p…
Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
121–130 of 363 posts
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#122Earlier quoted context omitted.
I've seen a good one -- actually got asked it in a phone screen I did last year: "How would you recursively delete all files with extension 'mp3' in a given directory tree?" The (simplest) correct answer (I know) is find /path/to/wherever -name "*.mp3" -exec rm -fv {} \; Maybe that's more of a pons asinorum , I suppose, but then isn't a pons asinorum precisely what a fizzbuzz question is meant to be?
find path -iname "*.mp3" -print0 | xargs -0 rm -fv
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#123Imaging science. If I were hiring another imaging scientist: Write your own Fourier Transform. [If your FizzBuzz questions involve actually writing/coding the FizzBuzz, I'd not request actually writing it...]
How would you weight a naive implementation of the DFT vs the FFT?
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#124I have been unable to think of one for Linux system administrators. :-(
I've seen a good one -- actually got asked it in a phone screen I did last year: "How would you recursively delete all files with extension 'mp3' in a given directory tree?" The (simplest) correct answer (I know) is find /path/to/wherever -name "*.mp3" -exec rm -fv {} \; Maybe that's more of a pons asinorum , I suppose, but then isn't a pons asinorum precisely what a fizzbuzz question is meant to be?
find /path/to/wherever -name "*.mp3" -deleteRe: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#125I was a mathematician, and now work in finance (systematic trading). I've found a reasonable negative filter is A jar has 1000 coins, of which 999 are fair and 1 is double headed. Pick a coin at random, and toss it 10 times. Given that you see 10 heads, what is the probability that the next toss of that coin is also a head? That tests their ability to turn a problem into mathematics, and some very basic conditional p…
The Monty Hall problem (or a subtle variant) is also great one to watch people work through. It's a chance to see if people can thing about probability in a sort of asymptotic way. Basically (if they get stuck), ask them how they would choose if there were actually a 100 doors, but the same rules apply. Obviously, everyone switches. What about 99? 98? ... turns out, 3 doors is the smallest number where the strategy i…
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#126I was a mathematician, and now work in finance (systematic trading). I've found a reasonable negative filter is A jar has 1000 coins, of which 999 are fair and 1 is double headed. Pick a coin at random, and toss it 10 times. Given that you see 10 heads, what is the probability that the next toss of that coin is also a head? That tests their ability to turn a problem into mathematics, and some very basic conditional p…
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#127I'm an electrical engineer who has pared my skill list down to 'troubleshooting.' For my equivalent of a fizzbuzz, the exercise is to present someone with a potential failure (the light in the room is off) and ask them how they'd go about investigating the problem. I like to see all kinds of answers, but particularly more theories are better, especially when justified at least loosely. Things like "change the light b…
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#128Earlier quoted context omitted.
The Monty Hall problem (or a subtle variant) is also great one to watch people work through. It's a chance to see if people can thing about probability in a sort of asymptotic way. Basically (if they get stuck), ask them how they would choose if there were actually a 100 doors, but the same rules apply. Obviously, everyone switches. What about 99? 98? ... turns out, 3 doors is the smallest number where the strategy i…
The problem with asking Monty Hall in an interview is that ~75% of candidates already know the answer.
If they don't know it, then ask to solve.
The early controversy with the Monty Hall problem was that explanations left loopholes, or weren't compelling enough, and even people who who should have known better didn't understand the solution clearly enough.
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#129I'm a software developer, but the code I work does a lot of DB access. I always ask a "two joins and an aggregate question." Given three tables: authors books sales ---------- ---------- ---------- id id id name author_id book_id title date price find the total sales by author in November 2013. The result set should have two columns: author's name and their total sales.
By "total sales", do you mean number sold or revenue?
I like this question because the base query, however you interpret the unclear parts, is easy, but it still allows candidates to impress me by asking about the "edge" cases. And even if they just makes assumptions, I can still ask them to do the other versions to see if they really know what they're talking about. I'm always amazed at how many people can't convert an inner join to a left join, or can't change a sum() to a count().