A surprising number of candidates I've seen interviewed cannot do the following, my code screener question: "Write a function that, given a set of integers, determines the amplitude (difference between biggest and smallest) of the set."
This is literally max(set) - min(set) in more words. I have seen countless people attempt this in different ways. My favorite was the guy that sorted the list and took the end values.
The worst is when I ask the follow up question: "where might I use this function?" I almost never get the answer of where I stole the function from (matplotlib): "the size of a graph", instead usually getting an "I don't really know".
I'm not so sure about this one. Software development is quite usually "build functionality to serve a given use case" whereas this line of inquiry is more along the lines of "find a use case for the given functionality".
Perhaps if you intend for the conversation to head into a chat about charting and data science?
If only :)
Some interview questions are like that, but this wasn't one of them. This is not "implement simple functionality" -- for that, you would ask e.g. fizzbuzz or "reverse the elements of a list".
This one requires you to work out something clever that reduces the time needed compared to the brute-force solution. You'll notice that, in this case, even someone at the end of a 4-year computing degree had to think about it for a while to figure out the shortcut.
Yes, once you have the insight that it can be reduced to max(set) - min(set), then it's a matter of writing a simple program. But obviously, this question isn't testing whether you can implement max(set) - min(set) when told to do exactly that. If that's all they were testing, they would have asked him that directly!
It is, rather, to test whether you are generally smart enough to, within the time of the interview, think of such a solution when it wasn't handed to you. To present yourself as having come up with that insight on the spot, when it really took you hours, is a kind of deception.
Yes people "cheat" their way to success. I hate it, but they do and we support it. From just a position of basic human integrity (forget about the law), Apple "cheated" by implementing the graphical user interface from Xerox Parc without adequate compensation. Then Microsoft "cheated" by implementing Apple's GUI as Windows. Then came the lawsuits. This happens again and again.
I have experienced this personally - the USDA RUS broadband program had written rules where an ISP had to work with their regional office and not walk their application through the front door in Washington DC. Yet being the first to apply through the regional office resulted in significant delays over our competitor walking their application into USDA headquarters against procedure. They got the $20 million. We did not. Any attempt to object or litigate would only hurt us further.
> If the fraud in your story hadn't been discovered, would that have been success?
I do not consider the author talking with Eli to be fraud. There was no obligation of disclosure. For all we know the reason why Microsoft repeated this question with so many applicants may have been deliberate to see how many applicants would actually get the solution by asking around. After all, isn't that how all of us code?
Normally with things like this the interviewer claims to want to "see how you think." If some prepared rote answer passed this interview phase, at the very least, the interview failed to meet its stated goal.
What's the difference between cheating and what's needed for your version of "success?" Can someone cheat their way to success? Or does seeing the answer key before the exam just mean being better prepared than the competition?
If the fraud in your story hadn't been discovered, would that have been success?