8 ms·
Actually this one might make sense, depending on the code and the position you applied for.
by hdjjhhvvhga 5y ago
Actually this one might make sense, depending on the code and the position you applied for.
- trinovantes 5y agoIt was for a junior c# position so I doubt it's applicable considering Visual Studio will point out the problems. But I'm curious what position would this question make sense?
- burntoutfire 5y agoIt doesn't sound that stupid, it checks whether you know the syntax of the language you'll be programming in.
- exdsq 5y agoDepends... imagine getting four pages of C# code and having to play Where's Wally but you're not even sure what Wally looks like. Surely it'd be better to just write FizzBuzz.
- mns 5y agoIt's literally asking someone to write perfect code in a time limited situation, under pressure, how can someone with any kind of coding experience ask someone else to do in an interview?
- killtimeatwork 5y agoIt not literally asking to write any code, just to read it.
- coldcode 5y agoNot one person ever code reviews code that was not already compiled. Requiring you know the syntax of a programming language (in my case, Swift, changes syntax in every release) outside of a compiler is pointless. I remember in the early days of J2EE people asking you for the home interface of an EJB stateful session bean. Like who the hell cares about memorization in the era of Google, and that was 20 years ago when Google did no evil. This isn't first year computer programming 101, you are paid to make things that work, not regurgitate syntax.
- michaelt 5y ago> I'm curious what position would this question make sense? I was once asked a similar but better posed question: I was given some code and asked what I'd point out if asked to do a code review on it. And the code had loads of things wrong with it, from bad variable names and incorrect comments, through unit tests that didn't have any assertions and loops that weren't actually loops, all the way to choosing a non-secure random number generator in an application that needed a secure one* In other words, it was a test of my ability to code review, with some glaring issues to give me some easy marks and set me at ease, and some subtle issues where talented people could really set themselves apart. It was fair and relevant to the job because I was presenting myself as a senior programmer with lots of experience doing code reviews and coaching junior developers. It's possible trinovantes's interviewer intended to give the same sort of test - but either didn't explain the question clearly enough, or trinovantes misheard or misremembered. * A bug right out of puzzle 94 in 'Java Puzzlers'
- w0mbat 5y agoCitrix gave me a page of code which had a lot of tricky obfuscated syntax problems. Code that looked live but was actually commented out, nested comments that were not terminated properly, code formatted in a very deceptive way, strings that were not quoted correctly so they would not end where expected on the page. It was all very contrived stuff that was deliberately deceptive, not like real broken code, and the errors would have shown up with syntax highlighting. I caught most but not all of the tricks. This is also the only interview I have ever had where a panel of engineers stood behind a desk and all barked questions at me. I did not get the job. At a different interview, this one with Microsoft, the lead engineer showed me a page of actual code from their app and asked me what I thought. Luckily the bug instantly leaped off the page to me, although many people would not see it. That was a good way of proving that I have a useful ability, and a better use of time than whiteboard coding or quizzes. I got the job and they were glad they hired me.
- RHSeeger 5y agoI tend to believe that "walk me through a peer review of this code" is a great interview question. It speaks to the user's familiarity with the language, with problem solving in general, and also people skills. Sure, it's not the end all/be all, but someone needs to be pretty amazing to want to work with them if they are incapable of doing a peer review.
- smt88 5y agoYour IDE can check your syntax. For people who have to switch between languages regularly, precise syntax memorization is difficult and a waste of time.
- MrDresden 5y agoWhile I understand where you are coming from, I disagree. IDE tools are great performance enhancers, but they can also be crutches. I would always expect a professional software developer to be able to parse some code on a page and point out its syntax errors (as well as suggest edits). edit; here I am thinking about something more substancial then just a missing ';' or a lack of a closing "
- deleted 5y ago[deleted]
- megous 5y agoLet's use (C++) something not common, but not all that crazy: bool x = false; x ||= something(); How many multi-lingual programmers will remember which one of the 7 languages they know does have a boolean assignment operators and which do not without looking it up? Does that make them unprofessional? How many do remember exact operator precedence rules for all those languages, when in practice you may need just the basic ones and use () to work around the lack of exact knowledge. Also which version? Something not working in PHP 7.3 may be ok in PHP 8, but company wants you to code in PHP 7.3, or ES5. In practice you get quickly acclimatized to any of the languages you know after working with them for a few days or a week, but good luck remembering exact rules of any of them at any given time when asked.
- HWR_14 5y agoYou're not mentioning or alluding to the one obvious syntax error. I don't know how to spoiler it so I will say there is an issue on the second line that, again repeating, I don't know how to call out. And yes, I work in multiple languages.
- ladberg 5y agoDesign mistakes maybe, but syntax errors are just not representative of any real debugging experience IMO.
- Terr_ 5y agoI could see it if you're resume talks about a whole bunch of intense recent development in the exact same language they want to test, but only then. In contrast, I've been stuck in a giant multi-language integration-fest, and... well, there are definitely languages on my resume that I would not be comfortable being pop-quizzed on, simply because I've been using others for the past two years.
- agent327 5y agoI've been doing C++ full time since 1996, and yet I frequently have intellisense warning me about forgetting something silly - like a missing capture in a lambda, or even forgotten semi-colons. That's because I'm not an f'ing compiler. _Can_ I make sure the code is 100% correct before even compiling? Sure, but I'll spend an hour checking every detail, while intellisense does it while I type.
- HWR_14 5y agoI mean, yes. In a whole program, typos or mistakes happen. No need to try to prevent those. So do spelling or grammar errors when writing in English. We expect a professional writer to have a human editor to catch those and not be perfect. But asking an applicant for a writing job to find the spelling/grammar errors in a paragraph seems reasonable to me.
- agent327 5y agoThe simple fact that you think so tells me that you aren't a programmer, and that you should stay far away from interviewing or managing programmers. About the only thing the two situations have in common is that both are based around a text-based medium; for the rest there is just no comparison between writing computer code, and writing text for humans. Have you ever noticed how very few people can actually write both good computer code, and good documentation for the users of that code? That's because they are completely different disciplines, requiring a completely different mindset. Let's turn this around: if I were interviewed by someone who flagged down my code for missing a #include or lambda capture (both very easy mistakes to make), I'd know that the people I'm interviewing with are idiots with no understanding of the thing they claim to be testing me on. Would I want to work there? Nope.
- rplnt 5y agoe.g. a compiler But yeah, I think I've seen questions like that for an intern positions. It's basically a "have you ever seen this language?" to weed out people quickly.
- baobabKoodaa 5y ago> It's basically a "have you ever seen this language?" to weed out people quickly. It's not that. People who constantly use multiple languages in an IDE will not be able to point out most syntax errors outside the IDE. So it's not a "have you ever seen this language" filter.