Live data from Hacker News

Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

news.ycombinator.com

121–130 of 363 posts

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#121

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…

Do you mind posting a simple walkthrough for the answer

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#122
post #37

Earlier 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

I'd give half marks for this, because it optimizes (meaninglessly) for processes, at the risk of ending up with "rm: Too many arguments" in a directory tree containing a sufficiently large number of MP3 files.

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#123
post #73

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

I wonder how effective of a test this would be. Are the algorithmic & implementation details of the Fourier transform that important to imaging science? I would imagine that explaining the properties of the FT, it's connection to imaging modalities, etc would be far more relevant than actually coding a DFT.

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?

#124
post #37

I 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?

Alternatively, you can just use

    find /path/to/wherever -name "*.mp3" -delete

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#125
post #59

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…

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 Tuesday boy problem is a little less known: http://mikeschiraldi.blogspot.com/2011/11/tuesday-boy-proble...

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#126

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…

[deleted]

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#127
post #9

I'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…

I have misread the last quote as "is anyone else in the room turned on" and wondered whether that's not a bit far out of the box ;)

Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?

#128
post #59

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

Assume they already know it, and ask them to explain it. A good explanation is almost as rare as understanding it.

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?

#129
post #50

I'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 mean total revenue, but I leave it unspecified in the hope that someone will ask for clarification. Same with if they should include authors with no sales during the time period.

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

Post reply on HN