r/programming • • May 09 '15

"Real programmers can do these problems easily"; author posts invalid solution to #4

https://blog.svpino.com/2015/05/08/solution-to-problem-4
3.1k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

117

u/Decency May 09 '15

They're decent questions for getting insight into the way people think.

When I give coding interviews, it's actually a lot more useful if the person's initial solution doesn't account for edge cases. So having a problem with a lot of edge questions that isn't also a you know it or you don't style question is non-trivial. These err a bit to the latter, and the first 3 are basically hello-world difficulty, but the final two would be pretty good. ESPECIALLY if you could whip up some unit tests before hand to run the person's solution through and then see their troubleshooting abilities.

I'm much more interested on whether you can iteratively improve on a solution, which resembles actual software engineering, than whether you can pull some complex algorithm out of nowhere that works on the first try in a 45 minute interview.

302

u/Stormflux May 09 '15 edited May 09 '15

Hmm. What bothers me about this is when we interview accountants, we don't give them "accounting puzzle challenges." We just talk to them, maybe take them out to lunch, that sort of thing.

With programmers, it's all "pop quiz, hotshot, you have a fox, a chicken, and some grain... explain to the fox why manhole covers are round, without using a third variable!" I mean, what the hell?

76

u/bikeboy7890 May 09 '15

I've had programming interview, and countless electrical engineering and computer engineering (and a few mechanical engineering) ones. That one programming one was worse than every other one combined. 7 hours straight of solving dumb puzzles and quizzes with a guy grilling you the entire time.

I was nervous as fuck, and despite feeling that I did well on all but one of them, got the call the next day that I wasn't their kinda guy. I was devastated for a few, as it was my FOURTH round with them, and I truly fell in love with the company during the interview process. Never again. It's not worth it to me.

Every other interview I've been to wants to know how I perform as a person, this programming mentality makes me feel like a pampered robot.

30

u/thatblondebird May 09 '15

This actually highlights the huge disparity between permie and contract job interviews -- I've only ever interviewed for one permie job (which I got, but from other peoples stories I can see was a "standard interview process"), but from my experience permie job interviews are long, more involved (multiple " tests", discussions with multiple people, etc.). I've never had a contract interview that was more than 45 mins and was generally laid back with mostly a "this is what the project involves and what you'll be doing" type conversation. Even better is the fact contract jobs pay at least 2x more!

18

u/BrightCandle May 09 '15

In the end the truth is you can do all these mental gymnastics in an attempt to find someone who you think can do the job and still get it dead wrong. You don't really need a good hiring process, you need a good firing process. Companies use contractors as they are easy to get rid of and not a surprise to anyone it turns out real work is a better test.

4

u/[deleted] May 09 '15

So much this. My company hires people in waves, and assigns them to an "R&D" project as a team for their first 3 months. The objective is to build out some feature or tool to help the business, while weeding out people who can't cut it. After that, the people who show promise are placed in existing teams throughout the company. It's the best way to see how someone is going to perform is a real setting, and saves the hassle of 8 hour long interviews that waste everyone's time.

→ More replies (1)
→ More replies (2)

16

u/dsartori May 09 '15

I was devastated for a few, as it was my FOURTH round with them,

Our industry really needs to stop with these absurd processes. I've been through this wringer a few times - sometimes successfully, sometimes not.

I don't think it is that hard to figure out if someone knows what they're talking about. If it takes more than an hour or two to evaluate someone's suitability I think you're doing something wrong.

In Ontario we have a probationary period of 90 days. If someone truly fooled you in the interview process and doesn't know what they are doing, sending them packing is fairly simple.

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

131

u/[deleted] May 09 '15

"Do you do a lot of work with foxes and manholes?"

"No, we do extremely dull CRUD apps".

38

u/[deleted] May 09 '15

Yeah, we write programs that query databases and display HTML. Now, back to the interview. Write a program that given the current time in hours and minutes on an analog clock finds the angle between the hour and minute hands.

10

u/pugglepartyadvanced May 09 '15

Holy shit, did we work at the same place? This is literally a true story for me. (Luckily it was just the one round of inanity -- I don't think I could tolerate the fifty rounds of interviews that some places want to do, even under the best circumstances.) But the quality of my coworkers there was rather, erm, variable.

8

u/DrugCrazed May 09 '15

You know you have a problem when you look at that question and think "Ooooooh that's a fun one. Let's see, first we have to..."

→ More replies (7)

106

u/ApatheticGodzilla May 09 '15

To become an accountant you have to pass a series of accredited examinations so you can have a piece of paper that legally entitles you to call yourself an accountant. Ditto lawyers, architects, doctors and (proper) engineers.

Until developers do the same (if such is even possible) we're going to have to put up with Fizzbuzz, questions about manhole covers, keeping a Github portfolio or whatever the interviewer reads off /r/programming or Hacker News.

38

u/CoderHawk May 09 '15 edited May 09 '15

Depends on the level of accountant and engineer. There's a lot of those out there with just a degree.

52

u/UncertainAnswer May 09 '15

There's also a lot of developers out there that have jobs that never had a coding interview.

Myself included.

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

24

u/Renegade__ May 09 '15

Until developers do the same (if such is even possible)

I have an examination certificate from the chamber of commerce saying /u/Renegade__ "has passed the final examination for the officially accredited profession of Computer Science Expert - Subject Area: Software Development".

What you are proposing has been a fact of life in Germany for years.

3

u/jooke May 09 '15

This is not normal across the rest of the world though.

4

u/Renegade__ May 09 '15

I realize that - I was just pointing out that it wasn't as unlikely or even impossible as the parent seemed to fear - it's actually standard operating procedure in one of the largest economies on the planet.

Basically, as in many cases when it comes to economy and labor, it's not that it's not possible, it's just that the American market doesn't want it.

3

u/Nyefan May 09 '15

But, but, standardized testing lowers overall quality... /s

→ More replies (14)
→ More replies (31)

49

u/c3534l May 09 '15

Accounting student here. The CPA exam is nothing but accounting puzzle challenges. All of my tests involve giving you partial information about a company and then you have to deduce what accounts receivable must have been at the start of the year or whatever. Accountant was probably the worst profession you could have picked for that example.

38

u/Razzal May 09 '15

A cpa exam is not an interview though. It is an exam, it is supposed to be test. When you go interview for a job they are not going to have you whiteboarding accounting problems

→ More replies (3)

31

u/learc83 May 09 '15

And will you have to take the exam every time you look for a new job? Because a programmer with 20 years experience still has to go through this for every single interview.

→ More replies (3)

9

u/awesley May 09 '15

Not all -- perhaps not many -- accountants are CPAs.

→ More replies (1)
→ More replies (2)

6

u/rabbitlion May 09 '15

Accounting doesn't involve creatively coming up with new solutions to problems in the same way that programming do. If you have completed an education in accounting they can already confident that you can perform the job adequately, and what matters is how well you will fit in the team.

Meanwhile, there are many programmers with a degree that can't program for shit and it's important to avoid hiring them.

2

u/Bwob May 09 '15

Well, how would you do it better?

Here's the problem from the hiring side: Hiring the wrong person (i. e. someone who can't do the job) usually ends up costing you about 6-12 months worth of their salary, even if you fire them after a month. This represents both the time you wasted trying to train them up, the time other people wasted having to do the work you expected them to do and fix their errors, and the time you spent sifting through applications. (This number is surprisingly constant - the more you're paying someone, generally, the more trouble they tend to cause if they can't do the work.)

So when hiring a programmer, you need some way to make sure they are actually a programmer. We don't have standardized accreditation. People frequently lie (or even just exaggerate) their resumes. So you need some way to make sure they're actually capable of programming.

So you ask them some basic programming questions to get them to demonstrate the skills that you're hiring them for. Because programming isn't just the art of writing out a list of instructions with weird capitalization and punctuation - it's also an art of seeing a problem you haven't seen before, and being able to come up with a sensible way of attacking it, and describing that method in small, basic steps.

Random brain-teasers are stupid, and I'm not defending those. But asking someone to come design and implement an algorithm to solve some minor problem (say, reversing a string or something) and then be able to defend their decisions when I ask about them, is still the best way I know of to get a handle on their actual programming ability. If you know a better way though, I'd love to hear it!

→ More replies (2)

2

u/RenaKunisaki May 09 '15

The idea is supposed to be that you ask these questions and see how they respond. How they go about trying to solve the problem and what ideas they come up with. Actually getting the correct answer is less important than demonstrating that you have the skills to think about the solution.

Unfortunately, many managers (in all fields, not just programming) just make up an application form with some dumb/trick questions and treat it like a high school test. Highest grade wins. (And often the questions are ambiguous and you're just meant to guess what the instructor manager had in mind, because guessing correctly shows that you think alike. Which is also nonsense, but anyway...)

→ More replies (4)
→ More replies (2)