Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

231–240 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#231

The whole game of studying is predicting what's going to be on the test, rather than nobly mastering the material in general and then doing well on the test by applying your knowledge. Anyone saying this is cheating either did badly in school, spent impossibly exorbitant amounts of time on school, or is being a hypocrite. Also, if the article hadn't revealed the interview question, I would've assumed it was like, wri…

> nobly mastering the material in general and then doing well on the test

This is what I almost always did, because I was there to learn and wanted to better myself and actually know the material. Sometimes I'd know some nonsense was on the test like memorizing an arbitrary complicated formula but that was the exception. Always tended to do well too.

Re: I cheated on my Microsoft interview (2019)

#232
post #209

Earlier quoted context omitted.

Can you elaborate on what made the question obscure? I'm asking because I used the question "print out the first 52 numbers in random order"in interviews before, and the answers seemed to give a good hint about understanding of basic CS concepts.

It might be the difficulty of actually getting it right (if by "right" we mean that all 52! permutations are equally likely. Or perhaps it is more accurate to say the ease of not getting it right. Something like this: 10 pick a number from 1 to 52 20 if not already printed it 30 print it 40 if we have printed 52 numbers 50 halt 60 goto 10 works, but could take arbitrarily long time. Most people prefer bounded run tim…

So what happens in your code if you just change the line

     j = random(0,51)
to

     j = random(i,51)

?

Re: I cheated on my Microsoft interview (2019)

#233
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…

True, but that doesn't matter at all given reasonable values of n. The number is in the range of n^2, but the algorithm is in the range O(1). Question is not that bad, my first thought was to use hash table to store what you see, then return when duplicate occurs. Don't like hash table fine, set an array of size n storing TRUE when you see the number. Notice it twice, then you've found the duplicate. No need for math…

Every solution is at least O(n).

Re: I cheated on my Microsoft interview (2019)

#234
post #134

One time a company I interviewed with asked me obscure algorithm questions about playing card shuffling. As a former professional magician I knew the optimal answers instantly and could jot them down straight away. They had allocated an hour for answers I wrote in a few minutes. I could have told them I had a massively unfair advantage, but I did not bother. They were visibly impressed and told me I was moving on to…

"I could have told them I had a massively unfair advantage, but I did not bother."

I guarantee they knew you had an advantage without you saying something.

That's the whole point of interviews - to find the candidates with the advantages over the other. The question becomes whether a specific advantage is unfair, or if any advantage is unfair.

Re: I cheated on my Microsoft interview (2019)

#235
post #200

Earlier quoted context omitted.

you would have lost me (principal engineer) with those questions.

Really? You don't like to socialize with peers, with puzzles or tricky problems? Enough to make you refuse to join a company? Discussion has gone off the rails here. Maybe I didn't make it clear - the puzzles were during casual conversation at lunch. Rebutting something I didn't say, is not fair.

Would have been a huge negative to me. I'm fine to chat with peers and discuss little riddles.

That is not what's happening when you're interviewing me for a job position. You're not my peer. We're not having fun. There's a non-subtle implication that my ability to answer the riddle will impact whether or not I get the job. I would be very annoyed if someone asked a puzzle like this too. It's not a novel puzzle. It's mostly a gotcha where intuition meets math. I could blurt out the answer. But I would instead feel it more important to slowly reason out the answer and appear to discover it on the fly. Which is pretty bullshit. And I would think you're not very smart for thinking this is worth anyone's time.

If I didn't know the puzzle and I failed to get the job I would be mad and it would stick out as something that penalized me unfairly.

Re: I cheated on my Microsoft interview (2019)

#237
post #209

Earlier quoted context omitted.

Can you elaborate on what made the question obscure? I'm asking because I used the question "print out the first 52 numbers in random order"in interviews before, and the answers seemed to give a good hint about understanding of basic CS concepts.

It might be the difficulty of actually getting it right (if by "right" we mean that all 52! permutations are equally likely. Or perhaps it is more accurate to say the ease of not getting it right. Something like this: 10 pick a number from 1 to 52 20 if not already printed it 30 print it 40 if we have printed 52 numbers 50 halt 60 goto 10 works, but could take arbitrarily long time. Most people prefer bounded run tim…

I like to use problems like this too.

What’s nice about this example is it provides lots of scope for discussion (as you did) without requiring much domain experience.

If the person can’t program their way out of a paper bag you’ll find out right away.

If they are a junior hire, any working answer is fine.

If they have more experience they can start to talk about why they chose the approach they did.

If they are quite senior you could talk about the benefits and limitations of different strategies, as you did.

In my case (if I still applied for programming jobs, which I don’t), I’d most likely do a naive shuffle and then discuss how problems using random numbers involve corner cases that require thought and domain knowledge I don’t have at my finger tips, so we could talk more about the (pseudo in this case) application needs so I could (in the real world) focus on the most important constraints.

As an interviewer I’m as happy, or even more happy, when the candidate knows their domain limitations and where they are important and where they are not.

Re: I cheated on my Microsoft interview (2019)

#238
post #224
post #134

One time a company I interviewed with asked me obscure algorithm questions about playing card shuffling. As a former professional magician I knew the optimal answers instantly and could jot them down straight away. They had allocated an hour for answers I wrote in a few minutes. I could have told them I had a massively unfair advantage, but I did not bother. They were visibly impressed and told me I was moving on to…

I answered one of those mind benders nearly immediately in an interview. I figured out the trick as they were telling it basically. They asked me if I had heard it before. I hadn't. A final interview with the CEO and he asked if I had heard it before and I said I hadn't. I later realized based on how they were asking if I had heard it before, they thought I was lying. The question: You get on a ski lift going up. It'…

This seems like a stupid answer for it to be n-1, but it also seems like a stupid question. What's the answer?

Re: I cheated on my Microsoft interview (2019)

#239
post #224
post #134

One time a company I interviewed with asked me obscure algorithm questions about playing card shuffling. As a former professional magician I knew the optimal answers instantly and could jot them down straight away. They had allocated an hour for answers I wrote in a few minutes. I could have told them I had a massively unfair advantage, but I did not bother. They were visibly impressed and told me I was moving on to…

I answered one of those mind benders nearly immediately in an interview. I figured out the trick as they were telling it basically. They asked me if I had heard it before. I hadn't. A final interview with the CEO and he asked if I had heard it before and I said I hadn't. I later realized based on how they were asking if I had heard it before, they thought I was lying. The question: You get on a ski lift going up. It'…

Is the answer that you pass all but one of the chairs going down?

Re: I cheated on my Microsoft interview (2019)

#240
post #224
post #134

One time a company I interviewed with asked me obscure algorithm questions about playing card shuffling. As a former professional magician I knew the optimal answers instantly and could jot them down straight away. They had allocated an hour for answers I wrote in a few minutes. I could have told them I had a massively unfair advantage, but I did not bother. They were visibly impressed and told me I was moving on to…

I answered one of those mind benders nearly immediately in an interview. I figured out the trick as they were telling it basically. They asked me if I had heard it before. I hadn't. A final interview with the CEO and he asked if I had heard it before and I said I hadn't. I later realized based on how they were asking if I had heard it before, they thought I was lying. The question: You get on a ski lift going up. It'…

So... the answer is "impossible to know"? There's no data on how many seats there are, their distance, or whatever. There could theoretically be literally just the seat you're sitting on in the entire system. Then the answer is zero.
Post reply on HN