r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

75

u/svpino May 08 '15

Agreed. In my experience, 1 out of 10 applicants know how to solve these problems. The rest taught themselves JavaScript in a weekend and stamp the word "Developer" in their resume.

0

u/[deleted] May 08 '15

[deleted]

56

u/zoomzoom83 May 08 '15

I've interviewed quite a lot of people over the years. These days I hire almost entirely through referrals and networking - meetup.com groups are great - but back when I was openly advertising for positions, a very significant majority of applicants that came across my desk couldn't solve even the most trivial "FizzBuzz" level problem.

14

u/Lawtonfogle May 08 '15

The problem isn't a solution. It is getting something close to a solution. Missing the fizzbuzz happening together, while meaning your answer is imperfect, is vastly better than the people who either don't have a clue what to do or write out 100 print statements.

0

u/[deleted] May 08 '15

[deleted]

18

u/Magnap May 08 '15

With enough stubbornness, you too can be Turing-complete!

→ More replies (5)
→ More replies (4)

55

u/zoomzoom83 May 08 '15

Agreed - I think that's something a lot of interviewers get fundamentally wrong.

When I give somebody a whiteboard question I'm not really interested in their solution so much as their approach to solving it. You need to treat it as a conversation between two engineers about an engineering problem instead of a graded exam question. I've been known to do this over coffee or beers without the person even realizing I'm interviewing them.

I've had plenty of candidates that struggle to get the answer I'm looking for and still hired them because they showed an ability to actually think critically about the problem - which is the skill I'm actually looking for.

25

u/LazinCajun May 08 '15

I've been known to do this over coffee or beers

You're just trying to locate their Ballmer Peak, aren't you?

12

u/secretpandalord May 08 '15

"Man, I know I'm doing pretty poor on these coding questions, just give me until the end of this drink."

→ More replies (3)

4

u/_jho May 08 '15

Can you elaborate on what you mean when you say "meetup.com groups are great"? Do people have coding meet ups or similar?

5

u/zoomzoom83 May 08 '15

If you look on meetup.com you'll find meetup groups for almost any topic in any major city. I regularly attend meetups for various programming topics for personal reasons, but it has a major incidental benefit of being a great way to find developers interested in a new job.

3

u/_jho May 08 '15

Well I'll certainly keep this in mind then.

→ More replies (4)
→ More replies (7)

38

u/OffColorCommentary May 08 '15

The people who can't pass interviews don't stop applying.

It doesn't take 90% of applicants being terrible for 90% of applications to be terrible.

→ More replies (3)

28

u/coffeesippingbastard May 08 '15

Jesus fuck...

I interviewed candidates at my last company. It was awful.

If I asked candidates "name some data types" they would look at me with a blank face.

Some would give me string or into so I'll move onto "Name some common data structures" shit- I'll take list/stack/queue/linkedlist/tree/heap again...blank face.

If they make it to fizzbuzz- I literally preface the question is "there is no trick- I don't give a shit about efficiency- just get it to work SOMEHOW"
I'll allow for mistakes, nerves, etc but god damn there are a lot of people who work in IT that can't code for shit.

18

u/OneWingedShark May 08 '15

If I asked candidates "name some data types" they would look at me with a blank face.

Type Bob is null record;
Type Steve_Boolean is (True, False, Steve);
Type Negative is Integer range Integer'First..-1;
Type Mike is delta 3#0.1# range 0.0..10.0
with Size => 8; -- Yes, a fixed-point with a step of 1/3rd.

But seriously? Unable to even name types or data-structures? Are these CS graduates of any sort? -- You might have a case for suing the degree-issuing institution for fraud.

8

u/secretpandalord May 08 '15

Some CS programs (I forget which, might not be true anymore) don't teach programming, they entirely teach theory. They're designed entirely to analyze what is possible to do with computers, rather than what people actually do with computers.

Fortunately, my program is pretty heavy on practical use and designing working software.

→ More replies (12)
→ More replies (6)
→ More replies (8)

11

u/mobileuseratwork May 08 '15

Also interviewed people in the past, and found a lot couldnt do fizzbuzz. I worked out you didnt even have to have them do it, just ask "have you heard of fizzbuzz?, if so explain why i asked about it". Those who had not heard about it usually could never do it (unless they followed it up by "im interested, please enlighten me"), those who had heard of it and could explain it could do it and were worth going to the next interview.

After i worked that out it cut the first round interview times in half.

26

u/rmxz May 08 '15 edited May 08 '15

fizzbuzz ... didnt even have to have them do it .... "have you heard of fizzbuzz?..."

You can't blame them for not knowing the name of a kids game only popular in England.

As for using "do you recognize fizzbuzz as a programming test" - that's pretty much asking if they follow one circlejerk of bloggers (Jeff Atwood / codinghorror.com and friends) that popularized the game as a programming litmus test. And you're right you don't even have to have them do it, because, yes, everyone who reads their blogs (even those who can't program) can pass that question.

Better to make your own question to get people who can actually program -- rather than those who just Jeff's blog.

(Personally I like the question "Assuming you're on a platform/language that can only do 32-bit multiplication, write a function to multiply 2 64-bit unsigned integers." This question shows if they can apply an algorithm that everyone already knows --- the exact same algorithm as 4-th-grade-multiplying 2-digit numbers by hand --- and turn it into code.)

26

u/caedin8 May 08 '15

The difficult part of this question is figuring out what you want us to code, which in my opinion makes it a terrible question. Questions should be obvious and clear, you don't want to pass on a bright developer because he didn't refresh on computer organization.

→ More replies (1)

8

u/FuLLMeTaL604 May 08 '15

write a function to multiply 2 64-bit unsigned integers

As someone who learned a little assembly, I'm assuming you divide each 64-bit integers into 4 parts then multiple the respective parts of each number together. 4 parts because if you multiple two 16-bit integers the highest number you can get is a 32-bit integer which the language can work with.

→ More replies (3)

5

u/[deleted] May 08 '15

We had fizzbuzz as a final exam question in an intro to java class. I had no idea it was a thing until a couple weeks later.

11

u/SilasX May 08 '15

You're really saying it's unreasonable to expect to do fizzbuzz without having heard of it?

9

u/[deleted] May 08 '15

No, he doesn't. He responded to someone who literally asks people for "fizz buzz" and thinks that is unreasonable, and furthermore holds that it's become too popular to be a good test because in addition to people who can code it will also pass anyone who knows about interviews for a programming position.

→ More replies (1)
→ More replies (1)
→ More replies (3)
→ More replies (8)

3

u/creepy_doll May 08 '15

What kind of organisation are you hiring for and how do you do your recruiting?

I'm genuinely curious because I'm at least under the impression(though I have no evidence) that places that have these issues have difficulty attracting talent and are forced to make public job ads which attract these kinds of "devs"

→ More replies (38)