3 ms·
I disagree. If you can't code IsNumber at least for plain integers you shouldn't be touching code. Then work up to negative/decimal Yes, for a lot of problems
by raverbashing 10y ago
I disagree. If you can't code IsNumber at least for plain integers you shouldn't be touching code. Then work up to negative/decimal
Yes, for a lot of problems you should go for stack overflow or a book. But this is a simple problem. SO won't have the solutions to all of your problems
- NumberSix 10y agoAs another commenter noted, for negative/decimal it is not so simple. That is why a highly experienced software engineer would look for an existing, fully debugged implementation rather than spend substantial time making sure all the corner cases are handled. In the context of an interview, it is highly likely a highly experienced software engineer will miss some of the corner cases. The exception would mostly be someone who has specifically studied and drilled on implementing isNumber(char * string) or specifically works in implementing these kind of functions which is rare. As I said there are libraries with these today.