3 ms·
As 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 debu
by NumberSix 10y ago
As 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.