Microsoft Interview Question

Design a function that converts a string to an integer.