Live data from Hacker News

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

news.ycombinator.com

151–160 of 363 posts

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

#151

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…

I've used a similar question, but with two coins. I think if I am ever in a position where I am hiring again, I may follow-up that question with this extension to 100 coins. What is the most common answer? Typically, I get either blank stares or a gut answer of just a little over 50%. I find that physics people are pretty good at solving the problem. I would also REALLY hope that somebody who is applying for a job in…

> I would also REALLY hope that somebody who is applying for a job in finance understands the bond prices and interest rates.

You'd be surprised at how many people can't answer instantly. Or how many people can't give a convincing description of what a share is, and what rights it gives you.

These are all easy questions, which to my mind is the point. The fact that someone can answer them doesn't tell you much, but if someone can't answer them then you need to think very hard about whether to hire them.

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

#152
post #60

Earlier quoted context omitted.

How well does the ability to write well correlate with the ability to articulate rules for writing well? I'd have thought there are a lot of people who can write any quantity of text with impeccably placed commas (and semicolons, when the required tone permits them), but would freeze and stutter and gabble if asked for "a couple of major comma rules". I'd put myself among their number, if only because it's not clear…

How well does the ability to write well correlate with the ability to articulate rules for writing well? The short answer is "pretty well." Usually I ask specifically for major comma rules, which I'd tend to define as: * Connecting independent clauses with a conjunction * As part of a list * To offset a word or phase at the start of a sentence. * Like parentheses (or, in the lingo, an appositive phrase). If they say,…

Known the rules is necessary but not sufficient for an A+ writer.

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

#153

Earlier quoted context omitted.

Good question, and one that sometimes comes up when I ask it in interviews. You are tossing the same coin 10 times.

0.753? A the beginning, there's a 1/1000 chance that you pick a double-headed, and a 999/1000 chance you pick a fair coin. A fair coin would act the way you've observed 1/1024 times. A double-headed coin would act that way 100% of the time. (This is where I get fuzzy): Given what you've observed, there is a (1000+1024)/1024 = 0.506 chance that the coin is double-headed. There is a 0.494 chance that it's fair. A doubl…

Your .506 is right but the arithmetic problem that you set equal to it is wrong. I think you meant to type 1024/(1024+1000). (BTW, it should be 1024/(1024+999) ).

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

#154

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 

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

#155
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?

Can't we cd /path/to/wherever rm -rf *.mp3 ?

It's supposed to be recursive. That would only delete the files in the current directory, not subdirectories as well.

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

#156
post #105

For a data scientist I ask "what's a p-value?" Both Junior and senior candidates often get this wrong. The only difference is that senior people bristle at such a simple question before also getting it wrong.

Ok, now I'm confused, because I was under the impression that this is the first thing I ever learned in statistics - that a p value is how likely it is that a value created by chance would have been as extreme as the one the experiment gave. Is this wrong?

You have the right idea.

You're assuming an underlying model for the data. You have a test statistic( that estimates a model parameter) and you have a hypothesis regarding a parameter. The p-value is the probability that you get a test statistic more extreme than the one observed assuming that your hypothesis is true.

Ex. You have a sample of 1000 men's heights. You compute the sample average height as 5'9 and a sample standard deviation of 3 inches.

(Unlikely) hypothesis: the average height is 4 feet. Your p-value is the probability of getting an sample average more extreme than 5'9 given that your 4 ft height hypothesis is true. Given that the sample standard deviation is 3 inches and 5'9 is 7 standard deviations from 4ft... the p-value is going to be small, so you'll reject that.

Note: I'm leaving out details and assumptions

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

#157
post #105

Earlier quoted context omitted.

Ok, now I'm confused, because I was under the impression that this is the first thing I ever learned in statistics - that a p value is how likely it is that a value created by chance would have been as extreme as the one the experiment gave. Is this wrong?

You have the right idea. You're assuming an underlying model for the data. You have a test statistic( that estimates a model parameter) and you have a hypothesis regarding a parameter. The p-value is the probability that you get a test statistic more extreme than the one observed assuming that your hypothesis is true. Ex. You have a sample of 1000 men's heights. You compute the sample average height as 5'9 and a samp…

Yeah, that's what I was taught. So what are people answering instead?

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

#158
post #108
post #22

Earlier quoted context omitted.

This is a bad FizzBuzz question, in my opinion.

It's one of those questions that provoke the most thought, allow granular benchmarking of the interviewee's knowledge, and have a valid answer, in my opinion. That is to say, this question has worked for us as a dev house, maybe not so much if you're hiring contractors, I can't say for sure.

That sounds more like a great interview question than a good FizzBuzz question though.

FizzBuzz questions are all about assessing, in less than 30 seconds, if you should even be giving the person on the phone the time of day.

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

#159
post #113

Earlier quoted context omitted.

Think you might be interested in applying? :-) We're hiring...

No thanks; I'm happy with the job I've got right now. But I appreciate you asking! More seriously, shouldn't it be possible to post a version thoroughly enough sanitized to avoid giving the game away to your potential applicants, without losing the sense of the original? You don't identify your organization in your HN profile, so it doesn't seem terribly likely anyone who's looking for hints on your hiring process wi…

Jumping onto this chain, I'd also like to take a stab at a sanitized version of your test. We often have to reverse engineer our Client's existing reports when creating new BI reports for them in Cognos, and I'm curious to see how challenging your 3rd and 4th problem sets are.

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

#160

Earlier quoted context omitted.

0.753? A the beginning, there's a 1/1000 chance that you pick a double-headed, and a 999/1000 chance you pick a fair coin. A fair coin would act the way you've observed 1/1024 times. A double-headed coin would act that way 100% of the time. (This is where I get fuzzy): Given what you've observed, there is a (1000+1024)/1024 = 0.506 chance that the coin is double-headed. There is a 0.494 chance that it's fair. A doubl…

Your .506 is right but the arithmetic problem that you set equal to it is wrong. I think you meant to type 1024/(1024+1000). (BTW, it should be 1024/(1024+999) ).

Close enough for beta. We'll refine after user testing. (Guess my specialty!)
Post reply on HN