3 ms·
When I interviewed for Amazon for a Java position, they had a C guy give the interview. When he asked me to implement atoi() on Java, Integer.parseInt() was the
by exabrial 10y ago
When I interviewed for Amazon for a Java position, they had a C guy give the interview. When he asked me to implement atoi() on Java, Integer.parseInt() was the not correct way to do things at Amazon. After that it was all sys admin questions about the version of Linux they use.
Somehow I managed to pass to the next level. I told them no thanks.
- lostcolony 10y agoI had the same problem with Microsoft (atoi), and the same issue with the interviewer (being a C guy)...the issue there was that he thought (stringInstance).length() was an O(n) op, so the fact I was calling it in my loop meant my algorithm was O(n^2). My explaining that, no, Java stores the length as part of the object...kinda tanked the interview.
- linkregister 10y agoYou describe the "interview anti-loop," a term coined by Steve Yegge, a prolific blogger who wrote about the Google interview process. Better luck next time. I've come across it a few times myself. Also I've legitimately bombed interviews, sending apology emails to the recruiter immediately after leaving.
- lostcolony 10y agoOh, there won't be a next time. A bit of sour grapes, but I also legitimately don't want to work for Microsoft. Even then it was more exploring my options; that interview tanking was more cynically amusing than it was disheartening.
- exabrial 10y agoHad a similar argument about forgetting the null terminator.
- cperciva 10y agoWhen he asked me to implement atoi() on Java, Integer.parseInt() was the not correct way to do things at Amazon. I have to agree with them here. If you're being asked to implement a function for parsing integers, they're clearly not looking for an answer of "I call a function which parses integers".
- jfoutz 10y agoI don't know how to get straight ascii out of a java string off of the top of my head. I guess in this situation i'd start with a little discussion of unicode, then just start with something like byte[] ascii; ...