Domanda di colloquio di Netflix

Implement atoi and itoa

Risposte di colloquio

Anonimo

27 set 2010

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

1

Anonimo

27 set 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.

Anonimo

23 ott 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); }

Anonimo

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; }

Anonimo

14 dic 2010

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