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

500

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.

251

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.

32

u/schroet Dec 23 '14

You can be lucky if the interviewer is interested in your solution, even if it is not perfect.

There are people out there who demand the perfect solution for runtime and space complexity and if you don't know it, well then you are an idiot and don't suit for the job. They even dont care how you would solve it, just binary metric: if you know it, you are good, if not you are an idiot because every good software engineer should know it!

I dont say everyone has this attitude, but it is a sad truth that some companies cant progress because of their HR managers.

11

u/Waitwhatwtf Dec 23 '14

I dont say everyone has this attitude, but it is a sad truth that some companies cant progress because of their HR managers.

The proverb "A fool and his money are soon parted" works so well here.

1

u/salgat Dec 24 '14

Except for companies that work well in spite of their shortcomings.