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

1

u/djk29a_ May 08 '15

I get the feeling that use of eval may not be the idea that the author had, but it's kind of handy for a lot of the "treat text strings as numbers" kind of problems that creep up a lot in these interview type of problems.

1

u/WeAreAllApes May 08 '15

If I were interviewing, I would hope someone who used it would say "well, I used eval. Is that okay?" They would get bonus points for getting it done and knowing what was wrong with it! For me, that's how these questions are useful beyond screening for basic coding skills -- they lead to the next phase of the conversation about performance, security, maintainability, design, etc.

How to do it without eval might be a good follow up question, depending on the types of problems the position needs to solve. For most developer positions, recognizing that eval is a flaw is enough to move on without trying to solve it....