Microsoft interview question

Implement conversion from string to number