Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I respectfully disagree that this problem needs anywhere close to an hour; and having the problem already broken down into rather simple steps is a significant amount of handholding.

As for being stressed -- if this is too much, how will you do when asked to solve even harder problems with tight schedules and/or demanding customers?



I agree with your assessment of the problem. It’s already been broken out into discrete chunks that are all simply solvable in short order. Even finding neighbor squares is reasonably straightforward (generating all 8 candidates is basically trivial, then pass them through a filter for each of the four edges).

But your take on the stress component of an interview is way off base. There’s a huge difference in having stress on you to deal with other people’s problems vs. your own. An interview candidate may be in financial trouble and may have been struggling for months to find employment in a terrible job market. This is existential stress on a completely different level than a customer wanting a feature yesterday.


I've solved plenty of hard problems at work, but none of them have ever looked like "count the grid squares adjacent to a given grid square while taking the grid's edges into account so the program doesn't blow up because you tried to access an invalid index."

And if I did have to do something like that at work, I promise my manager would give me more than 25 minutes to do it.


    sum += (x > 0 && y > 0 && x < x_limit && y < y_limit) ? a[y][x] : 0;
That took less than a minute of thought; or you could use a common technique in image and video processing, which is to make sure that the edges are always present but filled with appropriate values by defining your grid to be slightly bigger than the active area.


And it doesn’t do what’s asked? Congrats.


I just concentrated on what would be the hardest part, the "edge" cases (literally.) Wrapping that in a loop that goes through the appropriate indices is not much more work. There is a sibling dead comment to mine which has the rest.


Should probably use

  >=


You're assuming closed instead of open intervals.


I was assuming zero-based arrays.


oops doesn't count the edges. Take another minute.

-- joking -- :)


> if this is too much, how will you do when asked to solve even harder problems with tight schedules and/or demanding customers?

Isn't the whole reason you are joining a team is so that you have a support network when such situations arise? The period of acting alone to join that team is a temporary aberration and is to be recognized as such.

You may as well be the business selling to those demanding customers if you have what it takes to handle going at it alone. It will be far more profitable. But if you don't have it...


Not if the team expects you to pull your own weight, because they will be busy doing the same.


What, then, is gained by joining such a team? You're just taking a pointless pay cut.


> As for being stressed -- if this is too much, how will you do when asked to solve even harder problems with tight schedules and/or demanding customers?

There's no such single "stress". It's all different. Being yelled at by mom is "stress", and so is being held at gunpoint. Not the same kind of stress.

Making the slightest mistake or wrong impression during an interview pretty much ends it right there and by extension kills your chances of employment. Your entire future career and financial stability for the next 5-10 years hangs in the balance at all times during an interview.

Not comparable in any way to "the customer is being annoying today".




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: