Hacker News new | past | comments | ask | show | jobs | submit login

I think this is something you've studied and have entirely lost perspective. The way it is explained on the test actually does not make sense.

For example, does the triangle already exist or are we generating it/calculating it? Are we to iterate over the table? And if so then how? What data format is it in?

Let's also discuss this line:

> Each element in Pascal’s Triangle is found by adding the two numbers to the right and left of it on the row above it; where these don’t exist, they are assumed to be zero.

The way it is worded is just horrible. Try this one:

"At the tip of Pascal's Triangle is the number 1, which makes up the zeroth row. The first row (1 & 1) contains two 1's, both formed by adding the two numbers above them to the left and the right, in this case 1 and 0 (all numbers outside the Triangle are 0's). Do the same to create the 2nd row: 0+1=1; 1+1=2; 1+0=1. And the third: 0+1=1; 1+2=3; 2+1=3; 1+0=1. In this way, the rows of the triangle go on infinitly. A number in the triangle can also be found by nCr (n Choose r) where n is the number of the row and r is the element in that row. For example, in row 3, 1 is the zeroth element, 3 is element number 1, the next three is the 2nd element, and the last 1 is the 3rd element. "

With this diagram: http://www.mathsisfun.com/images/pascals-triangle-1.gif




> I think this is something you've studied and have entirely lost perspective.

I've studied programming sure; anyone who's studied programming should have no problem with this. In terms of this particular problem, not really. I've come across it before, and understood it immediately then as well.

I think you are fundamentally misunderstanding the process/reason behind such a question.

> For example, does the triangle already exist or are we generating it/calculating it? Are we to iterate over the table? And if so then how? What data format is it in?

These aren't reasonable/good questions. That is, only a person who hasn't paid attention, misunderstood the question, etc would ask these. They represent a flaw in the reader, not the problem as it was phrased.

I think the issue here is you just don't understand the process and reasoning behind this question. You seem to think it's some sort of "gotcha" when that's not the case at all. There's absolutely no reason you can't ask questions like you pose. Everyone sometimes has issues with the way things are worded...and being able to ask for clarification is important.

I don't see how your explanation improves anything; it doesn't add any information it's just more explicit and convoluted. Many (I'd say most) programmers can solve the problem easily the first time they encounter it with no background knowledge whatsoever. I did it, as have many others. There will be many people who need a little help, that's fine...this is not a test to weed them out. It's to weed out the people who don't ask for a little help, or just can't do it at all.


Most of the times and interviewer would intentionally omit some specifics about the problem the candidate must resolve, thus leaving room for questions. The questions the candidate asks in order to complete a certain task are as important as the task itself.

Regarding the above problem, in my opinion it has everything you need for a good understanding. The only thing it's missing would be some limits for n.

If you have trouble understanding this task, it means you have trouble understanding basic algorithmic problems as most of them are defined in a similar manner.

To also, answer jlangenauer's question: this would be a perfect interview task for a junior. If you find many candidates that fail this kind of problems, you should seriously consider a way of better screening your candidates. (phone interview, online tasks, etc).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: