DEV Community

Discussion on: I failed an interview because of an algorithm

Collapse
 
luiz0x29a profile image
Real AI

That's the solution anyone would expect, you don't need to know any algorithm for sort, but passing a comparator is such a basic thing.
You don't even need any algorithm to solve the problem.

Collapse
 
dannyengelman profile image
Danny Engelman

Typical example where humans fail. When they see numbers they want to calculate with numbers. Almost all 30+ answers in the mentioned SO thread do so.
I just added my answer. And probably would have failed every job interview if they only excepted the solution they themselves came up with.

stackoverflow.com/questions/683259...