r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

2

u/Luxelin May 09 '15 edited May 09 '15

Here's a solution for #4 in ES6:

var largestNumber = arr => arr.map(String).sort((a,b) => b + a - (a + b)).join("");

The question is whether you'd hire someone who would write this as production code.

2

u/mysticreddit Jul 22 '15

Except that is wrong. i.e. Counter-example:

 [420, 42, 423]