6 ms·
Is there any reason an interviewer should care about syntax, etc? When I interview, I ask for psuedocode - I don't really care what language the interviewee us
by alistairSH 11y ago
Is there any reason an interviewer should care about syntax, etc?
When I interview, I ask for psuedocode - I don't really care what language the interviewee uses, I do care that they can get their point across.
- jkarneges 11y agoThis happened to a friend. He confirmed that pseudocode would be acceptable, but then as he was writing it out the interviewer got on him about not terminating lines with semicolons (I suppose the pseudocode looked C-ish). So yeah I'd say make this clear.
- alistairSH 11y agoAck. I'm not sure how I'd react to that. I interviewed quite a bit last year (on the hiring side). I was really surprised by the variation in pseudocode written by the candidates. Most wrote something JavaScript-like, a few stuck to mostly proper Java or C. But then one dumped a giant web of crazy on the board (but still made his point) and one wrote something that looked suspiciously like COBOL - still not sure if he was trolling me.
- toomuchtodo 11y ago> Ack. I'm not sure how I'd react to that. Thank them for their time, leave, move on to next company.
- rhodysurf 11y agoI always write a weird mashup between python and C for some reason haha
- troels 11y ago"and one wrote something that looked suspiciously like COBOL - still not sure if he was trolling me." That's brilliant. Now I have to learn myself some COBOL just for that.
- huherto 11y agoYou will need to write a lot before you even start solving the problem.
- titanomachy 11y agoMy pseudocode used to be a sort of relaxed Haskell, because it's closer to how I think about a solution... but some interviewers rejected it as not resembling any kind of code, so now I use something imperative and Pythonesque, which hasn't gotten complaints so far. The sad thing was that in some cases the Haskell "pseudocode", unlike the Python, would have actually compiled and solved the problem quickly (within a factor of ~4 of C), and it took me about a minute to write. Unfortunately I think Haskell is disproportionately well-suited to these kind of toy problems, so being able to answer interview questions in Haskell doesn't tell the interviewers much except that you think yourself especially clever.
- amorphid 11y agoI wrote some Ruby in an interview. It was so terse, I had to explain to the interviewer (who favored Java) what the code did, and why it was linear instead of O(n^2). That was actually kind of fun.
- richardwhiuk 11y agoIf your code is sufficiently terse that it's not very understandable (such that the complexity isn't very understandable) surely that's a realistic red flag?
- gknoy 11y agoIf it's idiomatic Ruby (which some, like me, are not familiar with), I think it would not be a red flag if they could explain the details of what the syntactic sugar represents, and why its runtime is what it is.
- VLM 11y agoMy shipping boxes hold an even number of widgets, but I "have to" sell odd quantities and those need expensive mil spec styrofoam peanuts added to fill the hole. Here, have an array of possible shipment sizes. Given that array, if its shipping an odd number of widgets I wanna add an additional half widget shipping charge. newshipping = oldshipping.select{|i| i % 2 == 1 }.map{|i| i + 0.5 } My ridiculous fictional writing about shipping widgets is way more confusing than the idea that you can select and then chain right into a map. This probably looks really weird to a java guy but its not really all that mysterious. I wonder what that looks like in Java.
- fortpoint 11y agoIn Java it would look like this: List<Double> newshipping = oldshipping.stream().filter(i -> i % 2 == 1).map(i -> i + 0.5d).collect(Collectors.toList()); a bit more verbose but the essential chaining idea is there...
- 11y ago
- Buttons840 11y ago"Shame! You're not terminating your pseudo-code with semicolons!!!" I'd respond to that by drawing one huge semi-colon that spanned all 20 lines of pseudo-code.
- bshlgrs 11y agoIt sort of makes sense. If someone knows a language well, they shouldn't have much trouble writing it syntactically correctly on a whiteboard. Especially in languages which have simpler syntax, like Ruby vs eg Scala.
- jakub_g 11y agoIn his "Programming pearls" book, John Bentley stated that he always first writes non-trivial algorithms in pseudocode, and only then transforms them to the destination language. The point is, it's much easier to focus on the idea of the algorithm when writing it down in pseudocode, without having to worry about c / c++ details that obfuscate the idea.
- vlasev 11y agoI think this is less of an issue when you code in Python, where the code is already somewhat pseudocode-ish.
- joshuacc 11y agoExcept when you're used to working in an IDE that generates a lot of the syntactic cruft automatically.
- Retric 11y agoThat's far less true if you use several languages on a regular basis. .size .length .count, which one is used in _? Does it use () after it? Interviews are often based more on what the interviewer knows than the project / resume. Now what happens when someone asks about a language that you have not used in 3 years? Well it gets fuzzy. Ramping back up on an old language might take a few hours, but that’s meaningless in terms of a job.
- troels 11y agoI wouldn't call Ruby's syntax simple. Elegant, yes, but not simple. I'd consider myself a pretty seasoned rubyist, but my IDE catches syntax errors for me all the time.
- ionforce 11y agoI've had people interview claiming to know X and then not code in X correctly. So... that's a red flag. We allow interviewees to pick their strongest language. But if you end up picking something that doesn't exist, well, you aren't earning yourself any points.
- LoSboccacc 11y agoI wouldn't pass then since I live in post 2000 and am used to let the IDE handle the nitty gritty details while I focus on the actual meat of creating software
- econnors 11y agoI've had this problem as well. I go back and forth between Obj-c, python, javascript, matlab etc. so much without spending a significant amount of time on any one language that I often feel intellectually deficient because I don't know the nitty-gritty details of any of them. Curious to see what others think - is this something I should stop and focus on? Or in today's development environment is it considered acceptable to have to occasionally lookup language nuances in any given situation? For example, I couldn't tell you off the top of my head how to test for null in python. I'd assume it'd be if(obj), but after a quick google search it seems like if(obj is not None) would be the correct answer.
- projct 11y agohttp://exercism.io http://exercism.io has helped me to write more idiomatic code (submit a thing, get comments, refactor, also comment on other people's code.) Maybe it'd help you for the languages they have examples for?
- econnors 11y agoThanks, I'll have to try that out.
- jkaptur 11y ago
- at-fates-hands 11y ago>> I do care that they can get their point across This is kind of the point, right? Most places I've interviewed are far more interested in your communication skills, logic and thought process than writing perfect code on a whiteboard. Many of my friends have failed to see this is actually the reason they have you write code on a whiteboard.
- gohrt 11y agofriends who are candidates, or friends who are hirers? I see that problem on the hirer side.
- learc83 11y agoI hear that interviewers are really interested in seeing how you think and communicate constantly. Yet in my experience, if you solve the problem exactly the way the interviewer is looking for in a reasonable amount of time, you pass 9/10 times. If you don't, you fail.
- gohrt 11y agoYou should be able to carefully review a few lines of code for syntax errors. This is important because incorrect syntax might be ambiguous as to what it could mean. You should not be expected to write syntax-error free code on your first pass while solving a problem , without machine assistance