6 ms·
Choosing a Programming Language for Interviews
- tom_b 13y agoA follow-up question for interviewers lurking here on HN: What are your thoughts about candidates who code correct solutions in a language not in use at your workplace? I have a nagging feeling that some positions in my group have gone unfilled due to tech stack mismatches in candidates who were probably perfectly capable (or better) coders, but were most recently working in other tech stacks. Considering these types of candidates seems to be challenging in my workplace.
- viraptor 13y agoUnless you rely on a whole tightly coupled environment, like .NET+WCF, or some enterprise Java solutions and the question is based on them - the language in the answer shouldn't matter. If the candidate knows more than one language, they can learn more. Unless you need some specific framework/library knowledge, the rest is just syntax. And that's the least important part of programming. Exception: first jobs and very inexperienced people. Basically if the answer is given in a specific language because they don't know any other and couldn't produce the answer you want after short time of studying relevant docs, then it may be a real problem.
- TallGuyShort 13y agoI don't place much importance on the language used, but then my team uses a bunch of different programming languages because we integrate existing systems more than we write new ones from scratch. However, I do think the language choice itself says a lot about the person. If they reach for C, they're probably more interested in systems programming. If they reach for Ruby, they're probably more interested in web app development. If they reach for Bash, they're probably interested in SysAdmin-type work. Does their language choice reflect an interest in the job they're applying for? If it's reasonable to expect the person to know multiple languages well (i.e. they're not doing their first internship in college or something) I also want to see them pick an appropriate tool for the job. What I'm really looking for, is if the language they know best is actually a language they know well. If it's not, that's a red flag to me. I wouldn't say it's bad to do an interview in C# when applying for a job at a Java shop, but all other things being equal, using Java would be better, IMO.
- 727374 13y agoFor general roles, it's a question of how much you are willing to invest in a candidate before he/she starts producing. Big firms like Google/MS/Amazon are willing to hire strong candidates who aren't familiar with a given stack. A young startup might (understandably) not be able to pay someone for a few months to ramp up on a stack that's not familiar to the candidate.
- gaius 13y agoThat is subtly wrong, because there are really two things there: there is the language itself, and there is what has already been built with it. Say you get a really strong Perl guy, but you use Python. At a startup, he just has to learn the language. At a big company, he has to learn the language and the last decade's worth of codebase.
- 727374 13y agoYou are missing the point - startups don't always have the time/money to train someone in a new language. That's why they are looking for Javascript Ninjas who can hit the ground running. Established firms inherently have money to invest in training if they choose to.
- georgemcbay 13y agoIf you have hired the right person they will very quickly "train" themselves and the only cost to you will be a slightly slower start (which will resolve itself in days to a couple of weeks max) at producing real code. Well worth it if the alternative is hiring someone who knows the language/framework you're working in, but pretty much only knows that language/framework.
- fhd2 13y agoThe only real difference I see is whether or not I personally know my way around the language in use. If I don't know much about it (Haskell comes to mind), I have the candidate explain how to read the code. Doesn't happen often frankly, but I find it quite interesting, also gives me insight into how well I can understand stuff the candidate is explaining. I suppose the only thing that would make me frown is if the candidate was evidently a huge language zealot and wanted to use nothing but their language of choice. But I've never interviewed such a person actually.
- jerf 13y agoI happily and successfully hire people who don't speak the language(s) we use, but use languages in the same general area. I've shied away from hiring people who have no experience in the area at all. For instance, I'll hire within (Java, C#, C++, Objective C) reasonably happily (and that's not a complete list), or (Python, Perl, Ruby, Lua, JS) fairly happily (with a special callout for JS to distinguish between "JS but only in the browser" and "actually knows JS", the former not necessarily counting as knowing how to program at all), but I hesitate to hire if you have no experience in the target cluster. I think it's a big mistake to avoid hiring a Python programmer because they don't know Ruby, but it's one people seem happy to make, even in otherwise relatively enlightened organizations.
- SeanDav 13y agoThis reminds me about that saying: 'There are three kinds of lies: lies, damned lies, and statistics.' According to the table about relative popularity of programming languages, Javascript (5.2%) and C# (5%) have only 5 times the popularity of Scala (1%) and Haskell (1.2%). In most contexts, this data is just wrong. This just proves that unless you know or show the underlying method and context, quoting statistical summaries is almost completely pointless in trying to enhance your point. I realize that this is probably being a bit pedantic as that graphic is hardly the main point of the article however it does tend to place a question mark over the rest of the article when a seemingly dishonest bit of data is used to help prop up other points.
- super_mario 13y agoThe table is about relative self-reported popularity of languages to write answers to interview questions in, not to develop production code.
- cowls 13y agoIt specifically says: Consider this great visualization of the most popular coding languages of 2013 from the interactive practice problem website CodeEval:
- deleted 13y ago[deleted]
- tom_b 13y agoAs a non-traditional programming language fan, I'd love to see candidates throwing up working solutions or providing code samples in any language they choose. My co-workers, though, are a little more stuck in traditional thinking on this topic. Also, a number of them are programmers "by accident" and so have maybe picked up one or two imperative programming languages. Simply saying 'Haskell' or 'Lisp' or maybe even 'node.js' would make it impossible for them to make any kind of judgement on a candidate. You probably wouldn't even get an interview, but we are also fronted by a HR machine with a frightening array of check-boxes to navigate through.
- wyager 13y agoI always try to interview in Python, because I can bang out complicated ideas quickly with very minimal boilerplate. Writing in Python can be almost like writing in pseudocode.
- nilkn 13y agoI switched to using Python from Java for coding interviews and it almost felt like cheating. List comprehensions and the like don't necessarily trivialize many interview problems, but they certainly make them much quicker to solve.
- benhoyt 13y agoI can see why you feel it's cheating, but I think it's simply using the right tool for the job -- instead of worrying about which headers to include and what the exact C++ type specification for a map iterator is ... in Python, you can think about the actual problem at hand, rather than arcana.
- angersock 13y agoHas anyone had the luxury of using multiple languages in an interview? E.g., "Oh, you want me to twiddle bits? Let's do this in C.", "Oh, now doing silly text file stuff? Ruby.", "Write a simple properties thingy? Javascript.", "Find all permutations of blah? Lisp or Scala." I wonder how common that is.
- steven777400 13y agoFor my current position interview, there were several code samples I needed to write. One of the requirements was that I had to use two different programming languages (although I could pick which one for which sample).
- 727374 13y agoI was recently job hunting and chose to do coding problems in python when possible, even though I have 7+ years C# experience. For the first interview it got me into trouble because I actually didn't know how to read args from the command line and didn't have access to the internet! For all my other interviews (mostly Java jobs), I'm glad I used python for the simple reason that solutions tend to require a lot less boilerplate code than C#. I typically have to erase/change a couple lines as I'm solving a coding problem and using a terse language helps reduce this distraction. I don't think the interviewers minded and in one case I think using python gave me some (undeserved) mystique.
- at-fates-hands 13y agoPython is the most popular language at 30% in 2014? I've worked for a lot of big corporations and interviewed at hundreds more over the last few years. Not a single one used Python in any way, shape or form. Maybe that's changing, but I find it hard to believe.
- yeukhon 13y agoDefine big corporations? I am sure C++ and Java are still the most widely used in big corporations.
- at-fates-hands 13y agoBest Buy, United Health Group, Target, Medtronic. And I agree with you, I thought C++ and Java were more widely used than Python. The graph at the middle of the page in the article indicated Python was the most popular language at 30+%.
- yeukhon 13y agoThe main issue in the blog post is about "you, interviewee, which PL to use for coding interview" and the statistics OP uses is about what PL people uses on CodeEval (which is a place people go on to challenge themselves). So you are right about the doubt. Simply put, a lot of interviews tend to be fixed. Interviewees don't get to choose the PL to use during coding session. It is usually fixed. If you are interviewing for Java software engineer candidate, then coding in Python makes no sense. So that statistics does not reflect reality. It's merely to say that "Python and Ruby alike PL" are popular should the candidate has the right to choose a PL.
- peterbotond 13y agoIf I had this option during an interview, opt not a language, rather the idea to solve a problem described in Abstract Syntax Tree. This usually ends up in a pseudo code with parens.
- TheCoelacanth 13y agoSo, Lisp?
- oh_sigh 13y agoI tend towards python simply because most interviews are done on whiteboards, and python is a very concise language, which means I can average more logic per handwriting effort than I can with something like Java.
- NotDaveLane 13y agoOr... Have people use whatever they want so long as they are able to communicate their ideas, and move the focus to ensuring that they understand how software development works. You can teach syntax much more easily than you can train someone to think like a programmer.
- OhHeyItsE 13y agoRead in a file full of numbers, one number on each line Represent those numbers as integers in your program Replace each number with that number times its line number Write the file out elsewhere And complete the task right now at your computer as fast as possible, you’re being timed Think—what language would you immediately reach for? Do you start your experimentation with ipython, or irb? Do you pop open Eclipse and write some Java? Or create a new .cpp file? I have 13 years of experience leading teams in building and designing web applications in a wide variety of languages and platforms - some pretty big ones, too. I would not be able to do this in any language without looking at the API. And they wonder why "It's so hard to find good people!"
- merry-year 13y ago"leading teams" is very different from "coding 80 hours a week" IDEs like Visual Studio and Idea will show you classes, methods and parameters as you type. You only need to know which namespace to use for a given operation.
- benhoyt 13y agoI've been interviewing a fair bit lately, and I just really struggle with what you say above. To me if you can't write that simple program in some language without looking at an API or consulting Google at every turn, it feels like you haven't used the language enough (either that, or the problem isn't in a domain your familiar with, but you can usually tell which it is pretty quickly). I don't deduct points for not getting the syntax precisely, but if they don't know the very basics of "open()" and "for line in file" and "int()", but say they have 3 years Python experience, I'm thinking No Hire.
- OhHeyItsE 13y agoAnd that's where we disagree. I think this whole "FizzBuzz" craze is as equally stupid as the riddle craze was. My brain, right now, is working on a way to pop messages off of a RabbitMQ queue onto a clustered pool of Akka workers while minimizing the duplication of work and avoiding race conditions in the output. My career experience is in Java with a sprinkling of Python. I honestly cannot recall off the top of my head the I/O Api to do that task. Let alone on a whiteboard or in some shared google doc. Hm, I need to open a file. OK, no problem - new java.io.File(path). Er, wait, I remember there's a FileReader. Probably should use that. Do I need a File first? Or can I just give FileReader the path? Ah, shit - I need to read each line. I think that's a BufferedReader. How do I get from a FileReader to a BufferedReader? Is it constructor param? Wait, maybe FileReader _IS_A_ BufferedReader. So, I 'fail' the interview with you. Maybe your company has a need for someone who can write a 10 line script that can read a file line by line without having to look at the API while being timed. In that case, yes, you probably have weeded out a bad candidate.
- gre 13y agoAs a candidate, always use python.