Pregunta de entrevista de Netflix

Implement atoi and itoa

Respuestas de entrevistas

Anónimo

27 sept 2010

Seriously? They ask that for senior software engineer job? lame q.

1

Anónimo

27 sept 2010

Yep (cuz i sat in that room, too)... over and over, same questions, like they all read the same book. Thing is they aren't doing that stuff day to day.... and the heavy heavy emphasis on "performance" is a little funny. These aren't space ships they're controlling, just transactions.

Anónimo

23 oct 2010

atoi: #include #include #include int main() { const char* s = "12345"; int sum = 0; int len = strlen(s); int multiplier = pow(10, len - 1); for (int i = 0;i < len;i++) { sum += (s[i] - '0') * multiplier; multiplier = multiplier / 10; } printf("%u\n", sum); }

Anónimo

14 dic 2010

int atoi(const char* s) { int sum = 0; for (char* x = s; x != ']0'; ++x) { sum = sum*10 + *x - '0'; } return sum; }

Anónimo

14 dic 2010

typo: for (char* x = s; *x != '\0'; ++x) {