4 ms·
To be fair, using a library to do what you want is not what they're asking for. This is completely different from the functional vs OO discussion above.
by nambit 8y ago
To be fair, using a library to do what you want is not what they're asking for. This is completely different from the functional vs OO discussion above.
- exabrial 8y agoOn the contrary, if someone that worked for me needed to randomize a List and implemented their own function, I would be gravely concerned about the rest of work and what they're spending their time on.
- ummonk 8y agoAnd when Google implemented Java for Android, how, pray tell, should they have implemented Collections.shuffle?
- uryga 8y agoImplementing a stdlib isn't a thing you do every day. Presumably GP was referring to more common situations, where using the stdlib is (usually) preferable to rolling your own solution.
- anyfoo 8y agoThey were interviewing for Google. It's not uncommon to have to implement a standard library function (or not be able to use one) in many contexts at Google. Besides, the question is just the most basic setup to assess how a candidate would fare in comparable situations.
- XorNot 8y agoIs it though? Because the answer to "suddenly I need to implement a standard library" is "I google the accepted solutions" and if I don't have Google then I goto the library and check out a bunch of old CS books.
- ummonk 8y agoAnd then the interviewer's follow-up question should be "fine, since you don't want to indulge me and implement a solution to this toy problem, I'll ask you to implement a much more complicated function which doesn't exist in any library!"
- gaius 8y agoThey were interviewing for Google. 99% of developers at Google are doing commodity work. It is are practically IBM or HP now.
- monocasa 8y agoThey grabbed it out of harmony.
- anyfoo 8y agoBut you would not be concerned about a candidate that does not understand that this question is clearly (very clearly) meant to assess how they understand and approach algorithms and randomness? It's obvious that you should use a library function if there is a library function.
- pbhjpbhj 8y agoA question like "how do you reverse a string" surely is like asking a chef to cook an egg? Any idiot can do it, it's got to be an opening on to "who are my customers?", "what are the cost and time constraints?", "what team members do I have?" "what's our angle" ...? If the answer is just "boil it for 5 minutes" then you know you're looking at someone with simplistic thinking; which is fine if you just need someone to mindlessly do as they're told. They might be an absolute expert at it.
- anyfoo 8y agoYeah, it's just an opener. Setting the stage, making sure everyone is on the same page, and then you can build onto that à la "and now suppose xyz...".
- err0ne 8y agoSomething is wrong if you can't shuffle a list. I mean - I get that sometimes interviews can get a little too out there (a coworker was asking people to implement KMP in an arcane and long dead language) but shuffling a list. Seriously?