Live data from Hacker News

My Most Interesting Interview Problem

austinrochford.com

41–50 of 56 posts

Re: My Most Interesting Interview Problem

#41

Should not be described as points on a circumference? Doing it about points in a circle made me think of a different problem (which is also interesting) (Just to clarify, the circumference is the line that contains a circle. I assume that won't be misnamed in a geometry problem of this kind)

Canonically, a circle is the set of points equidistant from a given point (the center of the circle). The set of points inside the circle is known as a disc. Generalizing slightly, a circle is a 1-sphere and a disc is a ball in 2 dimensions.

So no, the post has it correct. In fact, circumference is the scalar value corresponding to the length of the circle. This relies on significantly more structure (i.e. having a metric) than the terms circle and disc.

Re: My Most Interesting Interview Problem

#42
post #37

in clear probability related context, the guy uses "uniformly distributed" and "normally distributed" interchangeably. I usually fail interview with such guys. The most recent spectacular failure happened when interviewer asked about sets, i described Java Set interface as an example (they are Java shop so i thought the choice was right), looking dissatisfied he asked to talk about "sets" in general, and got, lets sa…

It's not a good idea in an interview to antagonize your victims like this. The goal is to find out what they know, not be a forum for you to show off what you know. This is a very common mistake by interviewers.

I was saying it as the one being interviewed. I conduct interviews differently, in particular never give small problems, and mostly i just drill down various items on their resume (sometimes in the areas lesser known to me, so i'd learn something from the interview :) in the direction what they did, how, what alternatives were considered and why that specific design/approach was chosen over the alternatives, etc...

Re: My Most Interesting Interview Problem

#43
Q for the math guys:

Is this the closed form pdf of the angle distribution of one quarter of the circle?

http://www.wolframalpha.com/input/?i=1%2Fcos%28min%28x%2Cpi%...

1/cos(min(x,pi/2-x))

plus the normalization term to make \int(..) == 1:

http://www.wolframalpha.com/input/?i=int+1%2Fcos(min(x%2Cpi%...

Constructed by arguing that the probability is directly proportional to the length of the hypotenuse.

Re: My Most Interesting Interview Problem

#45

Should not be described as points on a circumference? Doing it about points in a circle made me think of a different problem (which is also interesting) (Just to clarify, the circumference is the line that contains a circle. I assume that won't be misnamed in a geometry problem of this kind)

If you're doing stuff with point sets, "unit circle" typically refers to the point set satisfying x^2 + y^2 =1, the "unit disc" or "unit ball" would be used to refer to the point set satisfying x^2 + y^2 < 1 (open unit ball) x^2 + y^2 <= 1 (closed unit ball).

Re: My Most Interesting Interview Problem

#46
post #37

in clear probability related context, the guy uses "uniformly distributed" and "normally distributed" interchangeably. I usually fail interview with such guys. The most recent spectacular failure happened when interviewer asked about sets, i described Java Set interface as an example (they are Java shop so i thought the choice was right), looking dissatisfied he asked to talk about "sets" in general, and got, lets sa…

It's not a good idea in an interview to antagonize your victims like this. The goal is to find out what they know, not be a forum for you to show off what you know. This is a very common mistake by interviewers.

Sounds like the parent comment was the interviewee, not interviewer.

Re: My Most Interesting Interview Problem

#47
To me, the answer to the actual question is so obviously "no", that I was almost confused. It's as though someone asked me, "which direction is the floor?" Anything that easy must have a trick.

So I though maybe it was related to "points" meaning actual rasterized pixels on the screen. The you get the slightly counter-intuitive result that the diagonal line actual has the same number of pixels as the vertical line, and thus will produce the same density of points on the circumference. However, this line of reasoning would require that we know the lines are far enough apart that they don't overlap pixels.

Re: My Most Interesting Interview Problem

#48
post #2

For the interested, the easieat way of generating random points on a circle is drawing (x,y) component-wise from a normal distribution and then normalizing the vector. (And two independent Gaussian variables can be easily sampled using the Box-Muller transformation.)

This would generalize properly beyond two dimensions, right?

Re: My Most Interesting Interview Problem

#49
post #39

Earlier quoted context omitted.

It's simple, clean, clear, and works well in low dimensions. I regularly work in a few thousand dimensions, and it doesn't work at all because the volume of the sphere is too small. These are great discussions to have with a candidate. If they already know these things then you can see if they understand why, and if they don't already know these things, you can see how they react to learning new and rather esoteric s…

Intriguing, what do you use something like this random multi dimensional sphere for?

Choosing a random direction uniformly for various varieties of hill-climbing optimization algorithms. The uniformity is necessary for the analysis of termination conditions.

Re: My Most Interesting Interview Problem

#50
post #43

Q for the math guys: Is this the closed form pdf of the angle distribution of one quarter of the circle? http://www.wolframalpha.com/input/?i=1%2Fcos%28min%28x%2Cpi%... 1/cos(min(x,pi/2-x)) plus the normalization term to make \int(..) == 1: http://www.wolframalpha.com/input/?i=int+1%2Fcos(min(x%2Cpi%... Constructed by arguing that the probability is directly proportional to the length of the hypotenuse.

It looks alright to me, but you'll have to normalise it for it to be a pdf
Post reply on HN