News for hackers. Stuff that matters.
Re:Common Algo Problem Solutions by MichaelBurge on Friday April 07, 2017 @11:42PM (#14065179)
I wonder if it makes sense for larger companies like Google to intentionally plant online unconventional solutions that seem plausible but have subtle errors. Better still if they point out the errors and give a plausible-sounding argument for why they don't apply, that the person then later repeats during the interview without disclosing that he's seen the problem before.

I wonder if there's a way to make money from cheaters caught in the act. The only thing I can think of is making reimbursement of travel expenses conditional on not cheating. Or encouraging them to somehow gamble money on the assumption their solution is correct.

Just using unconventional language to describe the solution could be a good signal: People learning something new often use the same words as the source material.

Re:Common Algo Problem Solutions by deft on Saturday April 08, 2017 @02:14AM (#14065584)
I'd like to know how this is 'cheating'. The questions are quite simply memorization problems as the difficulty increases especially. You don't have to disclose you've seen a problem before. These types of interview questions are already terrible, and now you are expecting interviewees to intentionally make it harder for themselves.

I don't get this anti-worker attitude. However I'm not surprised to see it on HN

Re:Common Algo Problem Solutions by cousin_it on Saturday April 08, 2017 @03:20AM (#14065772)
Algorithm problems are supposed to be solved by thinking, not memorization.
Re:Common Algo Problem Solutions by grey-area on Saturday April 08, 2017 @03:41AM (#14065823)
That's the theory.

In practice recent prior exposure to the problem and possible solutions makes answering such a question far easier, so the most prepared for the questions wins. They don't test thinking, they test preparation.

Re:Common Algo Problem Solutions by vog on Saturday April 08, 2017 @04:06AM (#14065897)
Not only that, but some worker may be well prepared without even noticing. And without any bad intentions to trick you.

This happened to myself (although in a non-interview situation):

In general, if you have solved many problems and looked at many solutions, you simply won't remember each specific problem. This effect may start as early as your first math olympiad, and will only get worse on university while you study math and/or computer science.

Some time ago I solved a math puzzle, where I got the right ideas relatively quickly, even though I was convinced this problem was new to me. Later I found out in my writings that I actually solved exactly that problem some years ago.

Even though I was unable to remember the exact solution, not even remembered I've seen it before, I seem to have internalized enough clues so I could rediscover the exact solution whenever I need it.

Re:Common Algo Problem Solutions by Sherxon on Saturday April 08, 2017 @09:49AM (#14066879)
You are right, thinking logically is always better option than memorizing solutions. To have a good thinking ability, one needs practice. Solving many problems leads you to think different approaches, compute running time and space complexity of your solution before writing code to any problem. I think, this is one of the best ways to improve "thinking".
Re:Common Algo Problem Solutions by ball_of_lint on Saturday April 08, 2017 @03:26AM (#14065788)
That's just plain wrong. What happens if you need for example ukonnens algorithm for creating a suffix tree? Good luck deriving that on your own. Similarly Fourier transforms. Memorizing what algorithms do and what types of problems they can solve is essential to being a programmer, and besides that it's simply faster.
Re:Common Algo Problem Solutions by cousin_it on Saturday April 08, 2017 @03:32AM (#14065805)
I agree that memorizing algorithms is useful. That said, Google interview questions are usually much easier than deriving Ukkonen's algorithm or FFT on your own. They are more like "given a rotated sorted array, find a given value quickly". Well, a bit harder than that, but solvable in 40 min.
Re:Common Algo Problem Solutions by bogomipz on Saturday April 08, 2017 @04:53PM (#14068968)
>"I wonder if there's a way to make money from cheaters caught in the act."

Wait, practicing problem solving is somehow "cheating"?

So we have an industry where a handful of SV companies have found that algorithmic parlor games are an indication of good hire vs bad hire. The rest of the industry has simply decided to mimic this practice with reasoning that goes "if Google's doing it it must be the right thing to do.", with no thought that Google's reality has so very little to do with their own.

So now that algorithm challenges are the bog standard for interview it would stand to reason that you would best yourself by studying or practicing some example problems. B that somehow is considered "cheating." So you are either born with these skills or you are not is that correct?

That is patently absurd.

So to weed out those who obviously did some studying we should seed the internet with misinformation in order to catch these "cheaters"? Is the thinking - if you weren't born with the skills to write a function to "search for the missing integer in a matrix that has been rotated by k elements" you probably aren't a good programmer?

Re:Common Algo Problem Solutions by johnfn on Friday April 07, 2017 @11:55PM (#14065214)
> I wonder if there's a way to make money from cheaters caught in the act

You would certainly save money.

Your argument reads a bit like a conspiracy theory to me, but it's definitely one of the more fun and reasonable ones I've read. :)

I was personally wondering why the "find duplicates" algorithm multiplied every number by -2. Maybe there is some reason, but I don't know what it could be.

Re:Common Algo Problem Solutions by ball_of_lint on Saturday April 08, 2017 @03:28AM (#14065792)
This is not really cheating, but it would help you weed out people who don't check the sources they learn from, which is also valuable.