Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

71–80 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#71
post #13

I'm surprised that atm there is a consensus in the comments saying that it's not cheating. Companies ask interviewers to not reveal the questions they had to other candidates. It's likely that his friend was told not to say that. Overall he clearly had an unfair advantage, and even if legally it wouldn't be the definition of "cheating" it would go against the intent of the interview: which is to evaluate candidates i…

What about a case where the interviewee is given an obscure problem to solve, yet already encountered and solved the problem in a different context?

It would be difficult to classify as cheating if they did not learn about about the question from an inside source. On the other hand, it also defeats the presumed purpose of the question (i.e. to test problem solving skills).

I was in that situation before, explained how I knew the solution, and did not get the job. While there were probably other reasons for their decision, they said they wanted to give the position to someone who was pursuing a career in software development, at the end of the day the candidate is going to be up against people who would offer up the solution with out further explanation. That is an awfully good way to stifle opportunities based upon the presumed (and possibly incorrect) intent of the question.

Re: I cheated on my Microsoft interview (2019)

#72
post #51

When I interviewed at my current company, I was pretty stressed about the interview and watched some Numberphile videos the night before to take my mind off things. Weirdly enough one of the problems discussed in the interview was about the Josephus problem which has a neat solution in binary [0]. I don’t recall if I ever asked the interviewer whether they also watched the video recently or how they came to think of…

Very cool video, thanks for the link!

Re: I cheated on my Microsoft interview (2019)

#73
post #14

I would not have though to use this formula. The sum of the integers grows as the square of n so if n is anything but small you will overflow and get an erroneous answer. This interview question has everything bad imo: no practical uses, test knowledge of math formulas (which every math/CS major would have but none of the self learning folks). It’s very easy to stress and fail when given such a test, and even already…

[deleted]

Re: I cheated on my Microsoft interview (2019)

#74
post #13

I'm surprised that atm there is a consensus in the comments saying that it's not cheating. Companies ask interviewers to not reveal the questions they had to other candidates. It's likely that his friend was told not to say that. Overall he clearly had an unfair advantage, and even if legally it wouldn't be the definition of "cheating" it would go against the intent of the interview: which is to evaluate candidates i…

It's a quiz problem, and it's supposed to have "trick" solutions.

However, if he wants to play that game, he should provide proof of his solution, not fiddle with syntax or error checking. That's why discussion is more important, and how he can show that understands what he's doing and not just memorizing tricks. (... none of which matters for his future role anyway.)

The formula "falls out" naturally if you're used to working with summations:

Σi = Σ(n-i+1) = n² - Σi + n

2Σi = n² + n

... but the xor solution is more elegant.

Re: I cheated on my Microsoft interview (2019)

#75
post #2

That’s not cheating, that’s not a problem at all. Neither ethical nor otherwise. You happened to know a working solution, this was by chance, but you also managed to sell it, explain it and it’s a solution you developped.

They could easily have asked him another question if they felt he was too quick with the solution for the first one.

All good.

Re: I cheated on my Microsoft interview (2019)

#76
The question is very unrealistic... how often do you know there is exactly one duplicate in a list?

Much more common is there are zero or more duplicates.

Here is what I came up with:

- We need a way to record what has been already seen

- A hash-map could work, but I think we can be more efficient

- We know that all elements are less than the array length in size...

- So we can allocate a single array of flags with the same length as the input

- The flag for value `n` is at position `n` in this array

    let findDuplicates xs =
      let seen = Array.create (Seq.length xs) false

      let mutable duplicates = []

      for x in xs do
        if seen[x] then
          duplicates 
I'm pretty sure this is O(n)?

I think it's interesting that the mathematical trick (sum of numbers 1 to n formula) does not work in the more realistic variant. This fact is probably why leet-code problems are so disconnected from the real world. It's like AI for board-games.

Re: I cheated on my Microsoft interview (2019)

#77
post #13

I'm surprised that atm there is a consensus in the comments saying that it's not cheating. Companies ask interviewers to not reveal the questions they had to other candidates. It's likely that his friend was told not to say that. Overall he clearly had an unfair advantage, and even if legally it wouldn't be the definition of "cheating" it would go against the intent of the interview: which is to evaluate candidates i…

I'm shocked too. Comapre it with people who applied too, but didn't have that "internal" knowledge Is it fair from that "not well networked" person perspective? It's not even like he found this question randomly on the internet, he got it from MSFT employee, lol. I have really mixed feelings about this Edit. Don't get me wrong, apparently author was(and is) capable of doing his job, so it isn't a big problem, but wha…

> Is it fair from that "not well networked" person perspective?

Fairness becomes a bit of a contrived concept once you start to factor in higher order effects. Then it just turns into fair if it advantages me, and unfair if it doesn’t.

I helped a friend get a job once because I knew who was going to interview him, and I knew he had a blog where he published all his thought-leader technical opinions.

Is that fair or unfair? Probably neither. It’s more of a random coincidence that my friend benefitted from this. But is it fair that I have learned more about my local industry by going to industry events and listening to people present things, and talking to people, etc? That probably is fair, and that’s how I learned the tip I gave to my friend.

Fairness isn’t really relevant to the problem here. If you believe that there is a problem at all, then the problem is that the screening process can be influenced by random coincidence.

Re: I cheated on my Microsoft interview (2019)

#78
When I did my geography exam at 16 I'd given up with normal revision, so I spent the morning reading about one particular extremely obscure topic - something like the natural resources of Nigeria - because it was on the back of the weekly installment encyclopedia my parents were buying for me.

It hadn't been mentioned in class. It hadn't even been mentioned as a possibility.

But it came up anyway. I wrote a nice little mini-essay on it, and I aced the exam.

I suspect that happens a lot in exams and job interviews. You get $random_question and it's supposed to be a test of broad knowledge, because clearly if you know the domain you'll know $random_answer.

But it doesn't exclude people who are lucky. (Or possibly mildly precognitive.)

Re: I cheated on my Microsoft interview (2019)

#79
I wouldn't consider it cheating. It was either a stroke of luck, or MS wasn't really doing an especially good job of reviewing their tech questions. A big part of programming (in my book) is finding the way that works; using whatever path is required. If you peek through a hole in the curtain to do so, then that's fine. Knowing about the curtain, and the hole in it, is part of engineering.

I remember taking a photography class, where the teacher said "The first rule of photography is to cheat."

He was talking about doing something like walking into a brownfield lot in The Bronx, and taking a picture at an angle, so it looks like a remote wilderness, but I understood perfectly.

I regularly look up the most basic algorithms with Google, and StackOverflow is an integral part of my workflow. I've been shipping software since 1986. I'm thrilled to have all this information at my fingertips.

Of course, I need to do due diligence, and make sure I understand whatever code I crib (I also usually rewrite it, so it fits my style).

If you want to consider that "cheating," then knock yourself out. Whatever creams your Twinkie. I don't care, and I'll keep doing it.

Re: I cheated on my Microsoft interview (2019)

#80

Earlier quoted context omitted.

It's not even a trick, though. The sum of zero and n is n. The sum of 1 and n-1 is also n. So is the sum of 2 and n-2, and so on. There are n+1 numbers when counting from zero to n, and they can be paired so that each pair adds up to n. It's a pretty obvious thing that anyone who spent much time thinking about math as a kid or teenager would have encountered, and maybe that's who MS wanted to hire! Especially back th…

Isn't this the famous Gauss proof/algorithm that he came up with when he was 5 or something?

I'm sure he got there earlier than almost anyone!

Just googled it, and it looks like he did is a little differently. He paired 1 with n and then 2 with n-1, etc... yielding n/2 pairs that add up to n+1. It still works out to (n+1) * n/2, though :)

Apparently biographers disagreed about his age at the time but they all had the same method and the same problem of summing numbers from 1 to 100.

Post reply on HN