Google
4.2 of 5 2,092 reviews
www.google.com Mountain View, CA 5000+ Employees

Google Software Development Engineer Interview Question

I interviewed in New York, NY and was asked:
"Convert string to integer like atoi in C"
Add Tags [?]
Answer Flag Question

Part of a Software Development Engineer Interview Review - one of 2,776 Google Interview Reviews

Answers & Comments

0
of 0
votes
int
myatoi(LPTSTR pszInt)
{
    int retval;
    TCHAR cSave;

    for (retval = 0; *pszInt; ++pszInt) {
        if ((cSave = (TCHAR) (*pszInt - TEXT('0'))) > (TCHAR) 9)
            break;

        retval = (int) (retval * 10 + (int) cSave);
    }
    return (retval);
}
- Brycej on Oct 29, 2013 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Google interview questions and advice. All interview reviews posted anonymously by Google employees and interview candidates.