Do Interviewers Frown at Potential Hires When They Use Ruby or Python to Solve an Interview Question?

The best answer to any question.
Aug. 16 2012 9:10 AM

Do Interviewers Frown at Potential Hires When They Use Ruby or Python to Solve an Interview Question?

ELau

This question originally appeared on Quora.

Answer by Edmond Lau, engineer at Quora:


Having interviewed a few hundred candidates across Google, Ooyala, and Quora, I would contend that the situation is quite the opposite, particularly if you're interviewing at the faster-moving end of companies like the typical startup. The choice of programming language matters, and most candidates I've interviewed who can code only in C, C++, or Java put themselves at a competitive disadvantage relative to those who use Ruby or Python.

In an engineering interview, you typically only have 30 minutes to an hour to impress your interviewer and to demonstrate that you can solve technical problems and get things done quickly. The faster you can complete a problem correctly, the more quickly I, as an interviewer, can move onto harder problems or assess your other skills.

Your choice of programming language is therefore important to the extent that it affects the speed with which you can solve problems. Languages like C, C++, or Java tend to be significantly more verbose than more productive languages like Python or Ruby that come with more powerful built-in primitives like list comprehensions, functional arguments, destructuring assignment, etc.

Research by Prechelt that compared 80 implementations of the same set of requirements across seven different languages showed that solutions written in C, C++, and Java were on average two to three times longer in terms of non-comment lines of code than scripting languages like Python. Paul Graham has also written extensively that one of the competitive advantages of his Viaweb startup was a more powerful and productive programming language.

The research lines up with my personal interview experiences, and I'd estimate that it takes the typical candidate roughly three times longer to express the same algorithm on the board in a non-scripting language than it does in a scripting language. In interviews where a candidate actually needs to write executable code on a computer, the time that a person spends compiling C, C++, or Java code is time that another candidate who's proficient at Python or Ruby is using to address the actual problem itself. Once you factor in the additional time needed to recover from mistakes or bugs, the absolute time differences start to compound. Each minute spent writing boilerplate code or additional syntax for a less productive language is a minute not spent tackling the meatier aspects of a problem.

The ability to choose the right tool for the job is an important skill. Choosing a less productive language makes me wonder as an interviewer whether you'd choose less productive tools on the job, like trying to write C++ or Java code to parse and format files when someone can be orders of magnitude faster using shell scripts or a scripting language.

There are two exceptions I would make for candidates that use C, C++, or Java on a problem that could be more quickly solved with a language like Ruby or Python:

  • If you're a fresh college grad who hasn't picked up a scripting language, I tend to be more lenient and evaluate whether I think you can pick one up quickly on the job.
  • If you're more experienced, really proficient at C, C++, or Java, and can solve a problem as quickly as a good programmer who uses Python or Ruby, then that's a strong a skill to have, and I'll take into account that it'd probably be easy for you to pick up a scripting language. Still, there would be a lingering doubt in my mind wondering why you didn't learn a more productive language over the years, since you would've been able to solve the problem that much more quickly.
Advertisement


All that said, there are probably certain interview situations where using a non-scripting language might be desirable. If you're interviewing for a search company or a company that focuses on iOS or Android development, using C++, Objective-C, Java, or whatever the core language is at the company would certainly help demonstrate that you could be effective on the job quickly. If you don't know a scripting language well, it's better to use a language you're proficient at, though it'd be even better to just get proficient at a scripting language. Ultimately, you want to pick the programming language that most effectively demonstrates that you'd be productive. My advice would be to ask your interviewer if he or she has a preference, and if not, to choose the most productive programming language for the problem.

More questions on job interviews:

TODAY IN SLATE

Medical Examiner

Here’s Where We Stand With Ebola

Even experienced international disaster responders are shocked at how bad it’s gotten.

It Is Very, Very Stupid to Compare Hope Solo to Ray Rice

The U.S. Is So, So Far Behind Europe on Clean Energy

Even if You Don’t Like Batman, You Might Like Gotham

Friends Was the Last Purely Pleasurable Sitcom

The Eye

This Whimsical Driverless Car Imagines Transportation in 2059

Politics

Meet the New Bosses

How the Republicans would run the Senate.

A Woman Who Escaped the Extreme Babymaking Christian Fundamentalism of Quiverfull

Nobody Knows How Many Gay Married Couples Live in America—Not Even the Census Bureau

  News & Politics
Politics
Sept. 22 2014 6:30 PM What Does It Mean to Be an American? Ted Cruz and Scott Brown think it’s about ideology. It’s really about culture.
  Business
Moneybox
Sept. 22 2014 5:38 PM Apple Won't Shut Down Beats Music After All (But Will Probably Rename It)
  Life
Outward
Sept. 22 2014 4:45 PM Why Can’t the Census Count Gay Couples Accurately?
  Double X
Doublex
Sept. 22 2014 4:06 PM No, Women’s Soccer Does Not Have a Domestic Violence Problem Or, why it is very, very stupid to compare Hope Solo to Ray Rice.
  Slate Plus
Slate Plus
Sept. 22 2014 1:52 PM Tell Us What You Think About Slate Plus Help us improve our new membership program.
  Arts
Brow Beat
Sept. 22 2014 5:45 PM The University of California Corrects “Injustice” by Making Its Rich Chancellors Even Richer
  Technology
Future Tense
Sept. 22 2014 6:27 PM Should We All Be Learning How to Type in Virtual Reality?
  Health & Science
Medical Examiner
Sept. 22 2014 4:34 PM Here’s Where We Stand With Ebola Even experienced international disaster responders are shocked at how bad it’s gotten.
  Sports
Sports Nut
Sept. 18 2014 11:42 AM Grandmaster Clash One of the most amazing feats in chess history just happened, and no one noticed.