News for hackers. Stuff that matters.
Re:How to Pass a Programming Interview by jkarneges on Tuesday March 08, 2016 @01:50PM (#11247490)
This 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.
Re:How to Pass a Programming Interview by alistairSH on Tuesday March 08, 2016 @02:26PM (#11247802)
Ack. 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.

Re:How to Pass a Programming Interview by troels on Tuesday March 08, 2016 @03:16PM (#11248224)
"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.

Re:How to Pass a Programming Interview by huherto on Tuesday March 08, 2016 @11:46PM (#11250995)
You will need to write a lot before you even start solving the problem.
Re:How to Pass a Programming Interview by titanomachy on Tuesday March 08, 2016 @07:03PM (#11249831)
My 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.

Re:How to Pass a Programming Interview by toomuchtodo on Tuesday March 08, 2016 @02:32PM (#11247839)
> Ack. I'm not sure how I'd react to that.

Thank them for their time, leave, move on to next company.

Re:How to Pass a Programming Interview by rhodysurf on Tuesday March 08, 2016 @02:52PM (#11248003)
I always write a weird mashup between python and C for some reason haha
Re:How to Pass a Programming Interview by amorphid on Tuesday March 08, 2016 @03:29PM (#11248339)
I 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.
Re:How to Pass a Programming Interview by richardwhiuk on Tuesday March 08, 2016 @03:33PM (#11248369)
If 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?
Re:How to Pass a Programming Interview by gknoy on Tuesday March 08, 2016 @03:51PM (#11248504)
If 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.
Re:How to Pass a Programming Interview by VLM on Tuesday March 08, 2016 @04:06PM (#11248629)
My 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.

Re:How to Pass a Programming Interview by fortpoint on Tuesday March 08, 2016 @04:37PM (#11248898)
In 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...

Re:How to Pass a Programming Interview by sk5t on Tuesday March 08, 2016 @08:02PM (#11250097)
The above, only if you want to discard (filter) orders with an even number of things.

Also I'm not sure about the use of floating point here...

Re:How to Pass a Programming Interview by kilotaras on Wednesday March 09, 2016 @05:41AM (#11252122)
Re:How to Pass a Programming Interview by Buttons840 on Tuesday March 08, 2016 @07:44PM (#11250023)
"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.