News for hackers. Stuff that matters.
Re:What every PhD should know before interviewing with a tec... by seanmcdirmid on Friday July 21, 2017 @04:21AM (#14818921)
Sort the array by absolute value, and then a check to see if two adjacent values are a negative/positive pair?

But seriously, giving programming problems like these to a PhD is probably going to scare the hell out of them, not because they think it's hard, but because they'll find it indicative of the work they'll be doing if they get and accept the position. Hopefully such faker filter questions are followed up with ones with real technical meat.

Re:What every PhD should know before interviewing with a tec... by kartickv on Friday July 21, 2017 @06:53AM (#14819428)
If the candidate does great, I'd definitely move on to more complex problems.

But this question lets me learn a lot about the candidate:

- How quickly did they come up with any working solution?

- How long did it take them to reach the optimal solution?

- Do they know time complexity?

- If they're using Java, did they use a plain array or ArrayList? Do they understand boxing and performance?

- Do they understand the range of an integer? I'd tell them that the array represents the population of the earth every year from 1900 till today, and see if they realise that they need a 64-bit integer.

Re:What every PhD should know before interviewing with a tec... by seanmcdirmid on Friday July 21, 2017 @09:01AM (#14820107)
As for the last point, would you expect them to tell you it's impossible for populations to go negative?
Re:What every PhD should know before interviewing with a tec... by kartickv on Saturday July 22, 2017 @12:03AM (#14825342)
No, they should be able to make that common-sense assumption, and you need a 64-bit integer in either case.