Live data from Hacker News

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

news.ycombinator.com

321–330 of 363 posts

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

#321

Earlier quoted context omitted.

The funny thing is, I imagine I'd fail this, and a lot of other "interview" questions. (Not fizzbuzz incidentally :P) Why? Because my brain just doesn't seem to work in the way people expect "experts" brains to work in our world of tests/qualifications. Now for context, I don't consider my self some wishy washy "Oh I have a different KIND of intelligence" making-excuses dumb as nails nancy. I've worked several years…

So, to see if I understand you: * The person suggesting the question says that this is trivial for people suited to the job in mind; * You say you couldn't do this question; * You also say that you would be suitable to do the job. Given that the proposer of the question is the one that understands the job, I'm having a hard time understanding why you claim you would be suitable for it, given that you couldn't do the…

Well, I'd disagree with at least two of your premises:

1) That the proposer of the question often understands the job. (by which i mean, in real world interviews. I'm not commenting on the specific poster).

2) I am not saying that I couldn't do the question, per se.

On the contrary, my professional work shows not only that I can do the question, but that I've probably done it innumerable times and to the standard of (and sometimes greater than) other professionals.

The subtext of my response to the bond question shows that, in an absolute juvenile sense, I "know" the answer that's being looked for because I've notionally been trained as en economist. Which is to say, I am aware of the rote learned current models/theory.

I'm saying that I probably couldn't answer it in the interview environment in the way that most interviewers would deem "acceptable" or "right".

Why? Because I both haven't memorized Bayes theorem, and wouldn't accept there as being a simple probabilistic interpretation applicable to real world problems. Now its true, I could probably attempt to re-derive it there in the interview from some even more basic understandings of probability, but is that what interviewers want? I'd almost certainly offer the answer of "Can i look at the two sides of the coin?" or "the probability is either 0 or 1". And then we'd go down the path of probability interpretations, and then only after they made it clear that they wanted a Bayesian approach, we could start heading in that direction. Is that what they're looking for? I don't think it is. But they are all valid responses.

I think they want someone who has remembered Bayes and its application recently and then just applied it. I think in the bond question, they want someone who has rote learnt some economic/finance theory. And I think the worst aspect is that the stronger candidate, who pauses, who thinks, who questions, and who doesn't just go down the regurgitated answer will probably, in real life, be marked as the weaker candidate.

And I'm also saying this as someone who is already employed, being paid and and working professionally on things the questions are supposed to be screening for. So while the original poster is in a position of authority to speak of such things, so am I.

Are you familiar with Project Euler? I've completed many of those problems as well, but I would never expect myself or some other candidate to be able to do them spontaneously in said interview, or think worse of them if they couldn't. And if they could do them, I don't think that would be an indicator of very much more than the fact that they happened to be working on said problem recently, had just taken a course on said problem, or had just been doing interview questions for my field.

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

#322

Earlier quoted context omitted.

So, to see if I understand you: * The person suggesting the question says that this is trivial for people suited to the job in mind; * You say you couldn't do this question; * You also say that you would be suitable to do the job. Given that the proposer of the question is the one that understands the job, I'm having a hard time understanding why you claim you would be suitable for it, given that you couldn't do the…

Well, I'd disagree with at least two of your premises: 1) That the proposer of the question often understands the job. (by which i mean, in real world interviews. I'm not commenting on the specific poster). 2) I am not saying that I couldn't do the question, per se. On the contrary, my professional work shows not only that I can do the question, but that I've probably done it innumerable times and to the standard of…

[deleted]

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

#323
post #316

Earlier quoted context omitted.

The funny thing is, I imagine I'd fail this, and a lot of other "interview" questions. (Not fizzbuzz incidentally :P) Why? Because my brain just doesn't seem to work in the way people expect "experts" brains to work in our world of tests/qualifications. Now for context, I don't consider my self some wishy washy "Oh I have a different KIND of intelligence" making-excuses dumb as nails nancy. I've worked several years…

What sorts of questions or tests were posed to you in interviews for jobs you ended up accepting? Or if you've never been in that situation, can you propose some interview techniques that would give the interviewer a good idea of your abilities?

Lets break down the role of interviews into two parts. The first part: To ensure the candidate is sufficiently-socialised and isn't a dangerous toxic mouth-breather. For this, current interviews can work relatively well. An hour or so, face to face, just talking back and forth mulling over problems/theory with an authority in the field or people they're working with.

I am genuinely skeptical about whether people who don't know what they're talking about can actually hide that fact from people who do know what they're talking about in such a situation. The secret of course is to basically ignore qualifications/status and do it as a conversation. Perhaps in such a scenario, five minutes in me and the original poster would be getting onto ridiculous questions of trading/probability with great big smiles on our faces and forgetting all about whether one can remember bayes off the top of their head.

The second part: Assessing the technical ability of the candidate at hand. And for this I think current interview culture is horribly toxic.

I do not work for Facebook, nor do I believe that such techniques are not without their flaws, and are difficult/expensive to implement, but I think techniques aimed at "actually get the candidate to do the task involved in the job, and see how they go" has merit. Forget your preconceptions about what is required. Give them a real world task you'd expect them to do in the job, the time it would be expected of someone in the job. The resources of the job. See how they go.: See http://www.kaggle.com/c/facebook-recruiting-iii-keyword-extr... for example.

Not perfect, but better than 5 minute "interviewer questions of the year".

Funnily enough, I got into my current organisation answering questions in the interview on analyzing health statistics. Something I knew nothing about. A senior executive then snatched/let me move across to his area in the more technical side of things without a subsequent interview after I made it known I'd be interested, and after working with their guys for a bit on another project. Swings and roundabouts :P

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

#325
post #312
post #285

Earlier quoted context omitted.

Well if I can count: 00000 00000 0 00000 00000 1 for 999 fair coins = 1998 + 1 for fake coin = 1999 1000 of which has 11. flip 0 So 1000/1999 ~ 50%

True. I glossed over the crucial part, which is that you have to enumerate the same number of potential outcomes for the biased coin's ten flips as you do for each fair coin, because each coin is equally as likely to be selected from the jar. Of course, all 2^10 potential outcomes for the biased coin's ten flips are the same: all heads. So we have: 00000 00000 0 00000 00000 1 For 999 fair coins = 1998 And 2^11 instan…

... because each coin is equally as likely to be selected from the jar

That's not the reason. It's because the fake coin also has two sides and therefore also 2^11 different outcomes. It just happens they all look the same.

Otherwise I agree with your argument.

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

#326
post #312
post #285

Earlier quoted context omitted.

Well if I can count: 00000 00000 0 00000 00000 1 for 999 fair coins = 1998 + 1 for fake coin = 1999 1000 of which has 11. flip 0 So 1000/1999 ~ 50%

True. I glossed over the crucial part, which is that you have to enumerate the same number of potential outcomes for the biased coin's ten flips as you do for each fair coin, because each coin is equally as likely to be selected from the jar. Of course, all 2^10 potential outcomes for the biased coin's ten flips are the same: all heads. So we have: 00000 00000 0 00000 00000 1 For 999 fair coins = 1998 And 2^11 instan…

[deleted]

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

#327

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…

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…

I vastly prefer Bayes Theorem as ratios vs. percentages (plug, wrote about it here: http://betterexplained.com/articles/understanding-bayes-theo...)

I like a "factor label" style approach where you can see the prior probability (Fair: Biased), the information about the flips, and the posterior probability (the revised chances after the new information is taken into account):

Prior * Information = Posterior

so

(Fair : Biased) * (10 Fair heads : Fair ) : (10 Biased heads : Biased) = 10 Fair Heads : 10 Biased Heads

Plugging in, we'd have:

(999 / 1) * (1 / 1024 ) / (1 / 1) = 999 / 1024

The odds are ever-slightly in favor of a biased coin. So we can mentally guess ever-slightly above 3/4 for the chance of another heads. We could write (999/2 + 1024) / (999 + 1024) on the whiteboard to be exact.

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

#328

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…

Given that this is hacker news, I'm surprised that no one bothered to write a simulation to sanity-check their answer. Here's a quick and dirty one: http://jsfiddle.net/qc9qk/2/

The mistake that most people seem to be making is using P(biased) and P(fair) instead of P(biased|10 heads) and P(fair|10 heads).

Spoiler: The answer is ~0.75.

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

#329

Earlier quoted context omitted.

Well, how about that! It could be that I formed my opinion regarding xargs before it got that smart, or it could be the old Red Hat boxes on which I mostly learned my craft didn't bother compiling in that capability. Either way, I'm glad to know about it now, and thank you very kindly for pointing it out to me!

breaking up the input into multiple executions is feature #1 for xargs and has been present since PWB UNIX in 1977

Then perhaps I'm thinking of "rm -f `find ...`". In any case, thanks for pointing it out; I learned something new today.

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

#330

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…

related problem: a population has a 10% incidence of condition X. A test exists that is 90% accurate. 1) What is the expected percentage of positive test results? 2) if a person tests positive, what is the probability that they actually have the condition? 3) if a person tests negative, what is the probability that they are actually free of the condition?

By "90% accurate", you mean "10% false positive rate and 10% false negative rate", correct?
Post reply on HN