Live data from Hacker News

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

news.ycombinator.com

111–120 of 363 posts

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

#111

My pet problem after FizzBuzz has been this for some time now: You are given a text in a file. Count all the words in the text and print out the words with their number of occurences in descending order. This can be depressing at times.

Define "word". However, strings separated by space:

Print number of words:

    wc -w 
Print words with counts in decreasing order:

    cat   \
    | gawk '{for (i=1;i
There are optimizations to be made, but that would be my go to solution in the first instance.

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

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

  find path -iname "*.mp3" -print0 | xargs -0 rm -fv

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

#113
post #93
post #74

Where I work, we have a 4 question SQL test where we sit you in front of a dummy database, give you 4 printed results, and say "make the queries to produce exactly these results." Very very few people get all of them, but it gives us an idea of where somebody is at in their ability and knowledge. The first is the easiest, and the second one isn't bad. The 3rd and 4th trip up most people though.

I'd be curious to see that test.

Think you might be interested in applying? :-)

We're hiring...

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

#114
post #11

Working for a web company. Our favourite JS question is, "What happens if you do this?" var func = function func () { // blah };

The variable declaration is hoisted to the top, then is assigned a named function expression `func` so that `func.name === 'func'`. Useful for proper error messages and stack traces. Something else I'm missing?

Yeah, the average applicant says something along those lines. The top applicants also mention the IE bug associated with named function expressions: http://kangax.github.io/nfe/

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

#115

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…

My wife and I have discussed this, and get a different answer to a few of the solutions we then googled for. I think it is as simple as: http://pastebin.com/gg5DTySG

I'm thinking this: http://pastebin.com/GW1hTXwD Dying to know if I made it through the math FizzBuzz :)

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

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

That seems like a recipe for holy-war between those who kind-of like xargs and those who think find | xargs is an abomination.

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

#117

Earlier quoted context omitted.

Should I parse it as tossing the same coin 10 times, or choosing from the jar 10 times?

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

This is a fun question. Can I look at the coin's two sides? If not...I assume you now have to start applying statistical tests (given that a fair coin will only do this once out of 1024 times, what are the chances I've got one of those 999 coins vs the 1/1000 chance that I picked the double headed coin?) or is there some simplifying assumption I'm missing.

Anyway--assume I think all that aloud in an interview. What does that tell you about the candidate?

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

#119
post #18

I'm an SE now, but I got my degree in Northwest Semitic Literature and Linguistics: Here's a couple: Are Semitic languages VSO or SVO? What does it mean that Semitic words are triliteral?

Isn't the semitic language a gotcha because of how arabic and hebrew have changed to SVO (while remainder are largely vso?) Or is that the point of asking?

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

#120
post #113
post #93

Earlier quoted context omitted.

I'd be curious to see that test.

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 will find it. And, hey, it's entirely possible you'll get feedback which helps improve the question you're actually using in your interviews!

Post reply on HN