Sollicitatievraag bij Netflix

Implement atoi and itoa

Antwoorden op sollicitatievragen

Anoniem

27 sep 2010

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

1

Anoniem

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

Anoniem

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

Anoniem

14 dec 2010

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

Anoniem

14 dec 2010

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