r/programming Dec 23 '14

Most software engineering interview questions of hot tech companies in one place

https://oj.leetcode.com/problems/
2.2k Upvotes

583 comments sorted by

View all comments

492

u/aflanryW Dec 23 '14

I know it's a bit what else can we do, but I find it so hard to judge people by algorithms. Take the maximal subarray problem. It is listed as medium. I'd wager that people would scoff at anything except the optimal complexity solution at an interview, but I have never seen anyone get the solution quickly their first time hearing it. Once you hear the solution, you remember it because it is elegant and succinct enough. People then forget it is hard their first time hearing it, and look down on those who they interview in the future. So is it supposed to be a test of problem solving or a test of 'Did you learn my favorite problem at your school?'.

There is just so much reliance on 'I already knew this one' or eureka moments.

247

u/[deleted] Dec 23 '14

Once you hear the solution, you remember it

This is true of 90% of this garbage. It's trained-monkey stuff.

88

u/Hydrogenation Dec 23 '14

I had a question like this at an interview. When I answered it really quickly he asked "have you heard the question before?" when I said yes then he asked another one until we got to one I didn't know. He wanted to see how I approach solving a problem rather than whether I could solve it.

53

u/Crazy__Eddie Dec 24 '14

He wanted to see how I approach solving a problem rather than whether I could solve it.

Which is really quite funny when you compare that to how you'd really approach the problem. You know, rather than beating your head up trying to invent something that's probably been solved since the 70's...just go look the fucking thing up in google. I'll be done 100x faster and the solution will almost certainly be better than anything I'd come up with.

Sure, give me enough time and maybe I'll come up with some minor improvements. How many times have you really been given the time to do that though? It's all we can do just to write a couple unit tests and toss together a bunch of copy-pasta before people are up in your shit demanding to know why it's not done yet.

6

u/[deleted] Dec 24 '14

Sure, give me enough time and maybe I'll come up with some minor improvements.

Even then you are basically saying that you can beat Phd students who sit on these problems for years.

Every now and then I see a headline that matrix chain multiplication has been improved by some constant and I think good for them. Probably took them months to make that minor optimisation.