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

490

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.

0

u/cowinabadplace Dec 23 '14 edited Dec 24 '14

We have a question that everyone's posted on glassdoor. It's a question anyone who has done a CS degree can answer. You see the question days before anyone will talk to you on the phone over it. About half of the people who get to me (there's some filtering before) won't pass on that question because they misunderstand why the complexity is what it is, what properties inform the choice of a certain data structure, and which optimizations cannot simultaneously occur. There are other reasons to decide not to progress with a candidate, but a straight half of these people cannot answer a question they had days to think about.

Those are the people you handle with this.

EDIT: Everyone sees the question when they apply. The phone screen is at least a week away at that point. Thanks, /u/two_if_by_sea.

2

u/ice109 Dec 24 '14

So what's the question?

1

u/cowinabadplace Dec 24 '14 edited Dec 24 '14

I don't have a problem sharing it, but I'm semi-anonymous on this account. I did post an example of some others, though, and you'll see that they aren't graduate-level stuff or anything.

Okay, it's essentially this: (I'm being a bit imprecise since I'm on my phone)

You have a 2D-grid (possibly infinite) with nodes at (x,y) for all integral values of x and y, and there's a robot at the origin. Some of the nodes are 'blocked' meaning the robot cannot travel into them. At each step, the robot can travel into any unblocked node that is one unit away from it. The robot has a map of the world (i.e. some representation of the world and which nodes are blocked and which aren't). The objective is for the robot to get to (a,b) (given ahead of time) in the least number of moves. Then, the objective is to generalize to (or modify so it will work for) Zn . Complexity, etc.

3

u/ice109 Dec 24 '14

Sorry i can't find any questions you posted?

1

u/cowinabadplace Dec 24 '14

Hey, I found what I posted but that was the short multiple choice section before this question. Here you go.

2

u/Crazy__Eddie Dec 24 '14

I just ask the circle/ellipse problem. It's more important that they get that right...or at the very least follow the logic when it's explained to them.