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/isHavvy May 08 '15

If you're going brute force then you might need map reduce, but if you note that it's equivalent to asking for them to be sorted in alphabetical order, even 100,000 numbers wouldn't be hard to do.

4

u/cloakrune May 08 '15

In the example they have, if you alphabetize and concat them you don't even get the correct result they gave you.

1

u/Tysonzero May 08 '15

Yup, even if you classify "no digit" as coming AFTER "9" you still end up with edge cases that can fuck you. See here

3

u/LazinCajun May 08 '15 edited May 08 '15

Except it isn't equivalent (don't worry, I made that mistake too at first)

1

u/[deleted] May 08 '15

Not only do you not understand how to do this. You also don't understand how map reduce works.