Live data from Hacker News

Interviewing programmers: coding test example explained

solipsys.co.uk

1–10 of 178 posts

Re: Interviewing programmers: coding test example explained

#3
post #2

So when do we get to read part 3? I want to see what "creative" solutions people came up with.

Currently working on that. It's safe to say that your two solutions were the most creative. In my graph of solution proximity, they are both a long way away from all the other solutions.

Re: Interviewing programmers: coding test example explained

#7
1) In TFA, s/cersion/version/, but that's an amusing typo. :-)

2) Initializing inside the for loop requires C99; is that to be considered idiomatic? I didn't think so. I'll be curious how many submissions were either identical to your suggested idiomatic solution or its K&R equiv:

https://gist.github.com/3f4daf24595788258a01

:-)

Re: Interviewing programmers: coding test example explained

#8
Am I OCD when I cringe when I see 'p_rite' where he (I think) means 'p_write'? That alone would knock a few points off a candidate doing this test when he's interviewing with me. 'rite' can mean 'write' or 'right' or even 'allright' - why the unnecessary confusion?

Re: Interviewing programmers: coding test example explained

#9
post #6

Interesting, when I solved the problem originally on my own, I got to the exact same solution just with different variable names and braces. I suspect that this is probably the most common way to solve it.

Yeah, I had almost exactly the same code. I'm sure most people did too. The only other "obvious" algorithm is the n^2 one.

Re: Interviewing programmers: coding test example explained

#10
post #8

Am I OCD when I cringe when I see 'p_rite' where he (I think) means 'p_write'? That alone would knock a few points off a candidate doing this test when he's interviewing with me. 'rite' can mean 'write' or 'right' or even 'allright' - why the unnecessary confusion?

You're not alone in feeling the OCD twinge, but are almost certainly alone in being willing to demerit a candidate writing that.
Post reply on HN