Live data from Hacker News

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

news.ycombinator.com

61–70 of 363 posts

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

#61
post #11

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

The function is able to reference itself, allowing recursion. This used to cause an error in Safari though, am I right?

That doesn't seem special:

    var foo = function (n) { return foo(n); }; foo(1);
gives back "too much recursion", not "foo is not defined", in both Spidermonkey (Firefox 24) and V8 (node.js 0.10.something).

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

#62
post #11

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

The function is able to reference itself, allowing recursion. This used to cause an error in Safari though, am I right?

A function can reference itself without defining the name twice. These both work just fine:

    var factorial1 = function(n) { return n 

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

#64
post #51

My Math "FizzBuzz" question is: prove Fermat's Little Theorem and Wilson's Theorem. Even those with very rudimentary understanding of modular arithmetic (coming from non-math backgrounds) can prove both with some pointers (obviously the process is interactive)

Interesting. I think the proof of Wilson's theorem is easy enough to be accessible for a non-mathematician - for non-prime n you can find a pair of numbers in the product (n-1)! that are congruent to 0 (mod n), and if n is prime then you pair up numbers in the product with their inverses until you are left with ±1.

But I can't think of a similarly low-level proof of Fermat's Little Theorem. Is there an obvious one I'm missing?

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

#65
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 wonder if that could be part of the assessment, to tell if the candidate is likely to verify uncertainties or make assumptions.

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

#66
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 problem with asking Monty Hall in an interview is that ~75% of candidates already know the answer.

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

#67

I'm a marketer, and have yet to find a way to judge a marketer's competence better than: "Here's this app, here's what it does. How would you increase downloads?" A quick brainstorm session shows you how they approach the situation, what tricks they have in their bag, and what methods they feel confident using (or if they're just BSing). Interestingly enough, 50% of the time people answer "SEO," which is among the wo…

Would the answer of the inverse question be interesting? Taking our successful landing page, how would you reduce downloads?

Remove the download link.

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

#69

I have been unable to think of one for Linux system administrators. :-(

1 - How to connect to a server using SSH without a password

2 - How would you check if $DATABASE is running and how would you start it if it wasn't. Bonus points: how do you make it start automatically at next reboot

3 - Show me the processes using the most CPU

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

#70
For sysadmin/ops jobs, I want to see debugging ability in addition to programming skill.

I usually ask about HTTP and DNS (for web-focused) or Kerberos/AD logins (for user focused).

There are a lot of moving parts to either of these, so a question like: "You type a web address into a browser, it doesn't load" can turn into questions about the DNS resolver process, system and network config, split horizon, time setup, etc.

Basically, I want to know if they have a grasp of how things all go together, and how to test the individual parts that make up the whole.

Post reply on HN