3 ms·
I wish I could, but it's been three years so I don't recall specifics. I do recall the last pair asked me to re-implement a java standard library functionality
by leeter 10y ago
I wish I could, but it's been three years so I don't recall specifics.
I do recall the last pair asked me to re-implement a java standard library functionality that was rather complex. It seemed out of place for an interview question.
While there are valid reasons to ask such questions they need to be framed carefully as to indicate why the developer would want to do so. Failing to do that causes frustration because in general the first rule is don't re-implement the standard library.
EX of good question: Facebook has their own COW C++ string with small string optimization because libstdc++ didn't used to have that. It can also provide massive speed improvements on multi-threaded code, what are some ways to implement this?
Ex of bad question: Implement a stringbuilder.
- Anderkent 10y ago>While there are valid reasons to ask such questions they need to be framed carefully as to indicate why the developer would want to do so. Failing to do that causes frustration because in general the first rule is don't re-implement the standard library. Seriously, you're bothered because someone asked you to solve a toy problem? Most interview problems are things one wouldn't do in the real job; that's because all real job problems take more than an hour to solve. Implementing a stringbuilder is a bad question because there's not much depth to it (after you get the basic implementation down, where do you take the question next?), not because there's a stringbuilder in the stdlib.
- isaacremuant 10y ago> I do recall the last pair asked me to re-implement a java standard library functionality that was rather complex. It seemed out of place for an interview question. Allow me to respectfully disagree. Even if they ask you something you or they don't think you can do, it's not just about really solving it but at looking at how you approach such a problem. No one can really solve important, long term problems in an interview but you sure can reason about them and talk/try toy solutions. > Ex of bad question: Implement a stringbuilder. You can always say "I probably wouldn't do this unless I had a good reason but, If i had to roll my own, I'd approach it this way:"
- jjirsa 10y ago> Ex of bad question: Implement a stringbuilder. We used to ask people to implement standard date-related functions. "That's stupid, all the date functions are already written, and they handle all the weird edge cases for you!" That's right - we want to see if you can think about all the weird edge cases. It's not about the obvious functions, it's about whether or not you can plan reasonable interfaces and think about edge cases.
- amzn-throw 10y agoWe'll have to agree to disagree. I think implement a string builder is a GREAT interview question. The point is to have a discussion. Why? What are the benefits of a string builder? When is it necessary? What performance characteristics should it have. What kind of questions do you ask, what kind of edge cases do you consider? It's an interview - if you are not sure why the interviewer is asking you to re implement a standard library, ASK. This is not unusual for Amazon - most tech companies these days ask these kinds of questions