I'm a mathematician, and sometimes I need to assess the level at which I'll pitch an explanation. Although I don't do this in a setting where it's possible to set a test, as such, I do ask this question: An equivalence relation is reflexive, symmetric, and transitive. If E is an equivalence relation, and we know E(x,y) but we know !E(y,z), what do we know about E(x,z), and why? It seems a great filter for people who…
x is "near" y and y is near x. y is not near z, so z is not near y, and therefore z is not near x nor is x near z.
Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
191–200 of 363 posts
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#192Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#193For 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.
This seems like a case where "why do we use it," an "how do we use it correctly" are obvious but the definition of what it actually is is a complexity we covered once in freshman statistics and never needed again.
You don't hire a telemarketer by asking them "what is a telephone" you hire them by making sure they know how to use one correctly.
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#194Where 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.
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#195For 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.
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#196I 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…
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#197This is an off-topic answer, but I see no reason why this thread shouldn't be generalized to FizzBuzz equivalents in other careers (in fact, it might be interesting to do so). Our electrical engineering FizzBuzz is an introductory, Freshman-level voltage drop problem, found within the first chapter of any Circuit Analysis textbook: R1 (N) R2 [VDD]-^^^^--*--^^^^----| Given VDD, R1, and R2, compute the voltage at node…
...Wat? That's like, one of the easiest questions you could ever be asked. As a senior undergrad in his final semester for EE (Computer Engineering specialization), could you give me an idea of some of the more difficult questions you would ask?
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#198Earlier 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…
Here is perhaps a more visceral example: On any given day, your car has a 10% chance of having blown a wheel the previous night. If it has blown a wheel, every bump will feel jarring. If it hasn't blown a wheel, any given bump will feel jarring with 10% probability. You drive over a hundred bumps, and all feel jarring. Do you think the next bump will also feel jarring?
Yes, right? Because the fact that the last hundred bumps have been jarring means you probably blew a wheel last night. Even though 'previous history has no effect on future outcomes', previous history does give you information about the state of the world.
Edit: Or a better example, for this community. You're on a slightly flakey wifi connection, which sometimes drops a packet at random. Any given packet is dropped with probability 1/100. Also, any given time you connect to the router, the modem is down with probability 1/10, and all of your packets will get dropped. You connect, and the first hundred packets you send are dropped. What is the probability the next packet will get dropped? Very high, because now you know that the modem is probably down. The history of the connection gives you information about the state of the connection. Similarly, the history of coin toss results gives you information about the state of the coin.
(Why is this different from roulette? Because there the previous history doesn't give you information.)
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#199Earlier quoted context omitted.
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?
Could you go into more detail about why you would do A) var func = function func() { /* blah */ }; Instead of B) function func() { /* blah */ };
if (addition) {
// operation = add
}
else {
// operation = subtract
}
If you use function declarations you might run into bugs if (addition) {
function operation (a, b) { return a + b; }
}
else {
function operation (a, b) { return a - b; }
}
console.log(operation(1,2));
Here it might happen that you don't get the expected function.Additionally it's much less clear what's going on. Compare it to this:
var operation;
if (addition) {
operation = function add (a, b) { return a + b; };
}
else {
operation = function subtract (a, b) { return a - b; };
}
console.log(operation(1, 2));
Here it's very obvious what's going on and your operation function has a name that reflects what it does.Personally I prever never to rely on function hoisting and always declare functions using function expressions. It keeps the code style more consistent and it's clearer what is happening in your program.
Re: Ask HN: What's your speciality, and what's your "FizzBuzz" equivalent?
#200Earlier quoted context omitted.
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?
Could you go into more detail about why you would do A) var func = function func() { /* blah */ }; Instead of B) function func() { /* blah */ };