Live data from Hacker News

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

news.ycombinator.com

201–210 of 363 posts

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

#201

Earlier quoted context omitted.

That's a nice filter. (Of course, I'm a former mathematician as well.) Here's how I think of it: - the prior odds that you picked the double-headed coin are 1/999. - after seeing ten heads, the posterior odds that you picked the double-headed coin are (2^10)/999 - let's approximate this as 1. (Bayes' theorem usually gets expressed in terms of probabilities, but it's so much simpler in terms of odds.) - so it's roughl…

Can you elaborate on the posterior calculation of (2^10)/999?

Sure. In terms of odds, Bayes' theorem says

(posterior odds) = (prior odds) * (likelihood ratio)

The prior odds are 1/999, so we need to show that the likelihood ratio is 2^10.

The likelihood ratio is the probability of seeing 10 heads from a double-headed coin divided by the probability of seeing 10 heads from a fair coin, which is 1/((1/2)^10) or 2^10.

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

#202
post #56

Earlier quoted context omitted.

Sorry Ohms law is not like a class or an object in any way at all.

he didn't mean literally like a class, it was an analogy. x is to y as z is to ...

Yes but an analogy needs to have some reasonable connection to the thing you are comparing it to for the analogy to make sense.

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

#203
post #169

Earlier quoted context omitted.

You didn't read it wrong, but you probably did fail the test ;-) There is no gotcha in the question, it's just a math problem that you either do or do not know how to solve. This isn't really about intelligence as much as it is about whether you have taken a course on probability. If you flipped 10 heads in a row the probability of the coin you have being the double heads coin increases dramatically, so you have to t…

"If you flipped 10 heads in a row the probability of the coin you have being the double heads coin increases dramatically..." I disagree. The coin is the coin. It didn't magically transport itself or change state after flipping it 10, 100, or a billion times. Lets change the puzzle to the simplest state: you pull a coin from the 1000-coin jar and flip it just once. What's the probability of heads? This is why roulett…

I think you're missing the point of the question which seems to get at whether the interviewee is familiar with/understands bayesian probability. For an excellent explanation you should see: http://yudkowsky.net/rational/bayes.

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

#204
Based on interviews, POMDP has become a favorite FizzBuzz question for data scientists. So make sure you have a working example for that. I usually explain the tiger pot of gold in gruesome detail. https://www.google.com/search?q=tiger+pot+of+gold+pomdp

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

#206
post #40

On/off producer + audio engineer. A good discriminator might be "it's squaring out; what do you do?". A good answer would lead to an argument about the compression war.

As a producer and non-native speaker, do you mean digital clipping?

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

#207
post #180

Earlier quoted context omitted.

Isn't the gotcha of this test the fact that the history of previous coin flips has no effect on the next flip , given a fair coin? The OP is only asking what the outcome of the NEXT flip is, not the probability of flipping 11 heads in a row. Or did I read this wrong?

The history of coin flips has no effect on the future tosses, BUT you can use the history of flips to try to infer which coin you are dealing with .

But that's not what the OP/Interviewer wants to know. All he asked was this:

"Given that you see 10 heads, what is the probability that the next toss of that coin is also a head?"

He didn't ask you to identify the coin. He just wants to know if the flip is going to be heads.

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

#208
post #178

Earlier quoted context omitted.

I was surprised I could actually think of 10. Using both dc and bc seems like cheating, though ;)

To be honest, a reason I like it is that if they free-think and say 'what about sed, oh of course thats three characters', shows what they know. Also whether shell-built ins count too.

I'd grant bonus points for remembering the standard text editor. Or dismiss everyone who didn't!

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

#210

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.

I would make a couple of assumptions: - price could be 0.0 for a book - Total sales means the sum and not count - Date format will be yyyymmdd (if not, assume that we converted in Oracle or Sybase) SELECT a.name, SUM(s.price) FROM authors a INNER JOIN books b ON (a.id=b.author_id) LEFT OUTER JOIN sales s ON (b.id = s.book_id) GROUP BY a.name HAVING (s.date >= '20131101' AND s.date

s.date is not a group column and a.name seems like a bad PK
Post reply on HN