Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

201–210 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#201
post #84

Earlier quoted context omitted.

That's harsh because TFA does mention that they feel outright uncomfortable (even after 18 years!) how big a role luck played in them clearing that fizzbuzz interview question: > I've struggled with this a lot over the years, but I finally decided to share my story. I don’t think I would have made it past the first round of interviews at Microsoft if I hadn’t gotten so lucky. So pretty much, my entire career is built…

Out of pretty much all the people I know, I can't think of any successful career not pivoting on one such fateful moment of "luck". One lucky question/answer, one fortunate encounter, one near miss. Of course we'll never know how the road not taken looks like. Any moment could actually be a pivotal one but most are very unassuming and only the memorable ones stick with us, making them feel more important. Also, as so…

Not disagreeing with your points.

> Preparing for this kind of question isn't cheating as long as you understood the answer.

TFA notes that because of lack of interview prep material in 2004, even when the author knew the question before-hand, it took them days to arrive at an optimal answer. And then it dawned on them that everyone else at the job fair, who may be seeing a question for the first time, only had 15 mins in a pressure-cooker situation to solve it.

TFA also notes that the author intentionally misled the interviewer as if they were solving the puzzle then and there: I casually explained how I could simply use a mathematical formula to calculate the sum of 1 to n (like, who doesn’t know the sum(1 to n) formula?) and compare that to the sum of the integers in the array. I slowly wrote out the solution I had come up with over days of thinking about the problem, being sure to pause periodically as if I was figuring it out for the first time. I talked through my thinking and made sure I had all the proper error checking in place. I double and triple checked my syntax. My handwritten code was perfect.

Re: I cheated on my Microsoft interview (2019)

#203
I don’t think this person would have done badly on the interview if they hadn’t practiced the question in advance. At least according to the narrative, when they first heard the problem they thought about summing the numbers: presumably they would also have gotten there during the interview.

It also begs the question that a direct path to “perfect code” is the intended goal. Admittedly this story takes place quite a while ago and there’s no one approach to interviewing in big tech, but I think it’s safe to say it’s generally a more nuanced evaluation. In a situation like this, the textbook approach is to start by proposing a quick and dirty naive solution, like storing all the seen values in an array, and telling the interviewer why or under what conditions you think it’s a bad solution. You could realize that there’s only one bit needed, so you could track eight values per byte. That’s probably the point at which the interviewer might prompt you to start coding, since there are a few details to get right to show that you know how to implement a simple algorithm, and there’s opportunity for followup about boundary conditions, scaling, big-O, etc.

At that point, you may have enough time for another prompt like “can you think of a way to do it without an array to store all the values?” If the candidate is still stuck, I’d offer them “what if I give you this formula for the sum of the numbers from 1 to N?” Similarly, if at some point earlier on they said “I think there’s a formula for this”, I’d probably give them a minute to think about it and then just tell them what it is. Because I want to move on to see if they can implement it.

Are a lot of FAANG interview questions math puzzles pretending to be programming questions? Unfortunately, yes. It’s hard to avoid when you have a people who are smart at math and not particularly skilled at interviewing. They tend to create questions based on something they’re impressed with themselves for knowing. I’m not suggesting anyone has solved the problem of how to decide, based on 45 minutes talking to someone, whether they’re going to be successful at the job.

Re: I cheated on my Microsoft interview (2019)

#204
post #112

Earlier quoted context omitted.

Cheating is bad - this is an overly broad and generalized position, isn't it? Lets say the blogger had seen that n+1 question online somewhere or in a book (instead of hearing from his friend), before the interview. Is he obligated to inform the interviewer in this case too? There are many people who get stressed and can't really write good code in an interview setting, but are perfectly capable of writing great soft…

I'd like to agree with the statement Cheating is bad . I don't think that's overly broad and generalized, or not nuanced and complex enough, or naive. Like the GP, I'm amazed at the number of people on here[0] who somehow seem to think cheating is fine. In real life I've never heard anyone defending cheating as ever a good thing, I guess. When I hear the word "cheating", it..just sounds like an obviously bad thing. S…

I am not saying cheating is fine, all I am saying is that it is not as rigid as rules in mathematics. If we are just talking in strict theoretical sense, sure, all cheating is bad. But life doesn't work that way. This is why we have courts and judges and lawsuits.

My guess is this (based on nothing but personal opinion) - most people would say cheating is bad, but the same people wouldn't be surprised at rampant cheating that happens around them. They may themselves even cheat, if they get a chance. Whether we like it or not, cheating happens all over, so people are just used to it.

Re: I cheated on my Microsoft interview (2019)

#205
post #58

I actually cheated on an online assessment for one of my first programming jobs. It was my dream job and really wanted to get into that company. Under the pressure, I just couldn't figure out the solution to the last challenge which was a recursive algorithm. Normally, I would be able to do this but I just got stuck and in a moment of panic, I StackOverflow'd the question on a secondary device which provided me the e…

what company is that?

Re: I cheated on my Microsoft interview (2019)

#206
"So pretty much, my entire career is built on one amazing stroke of luck."

This, to me, is the buried lede. Much of success is due to luck. Not all; some people on balance are more talented and persistent and hard working than lucky. Others have more luck (a referral, inside info for helping them prep, etc.). I just landed a new job that I am quite confident I would not have been considered for without a referral from someone close to me working for the company already.

After multiple rounds of interviews and assessments I am confident they feel I am a good match, but without the luck of that referral I very well may not have gotten past the call with the recruiter.

Re: I cheated on my Microsoft interview (2019)

#207
post #150

Earlier quoted context omitted.

I once worked at a tech-focused games company (sadly no longer existing) which had the best interview process I’ve ever seen. They had this massive programmer test. It was something like 40 pages long, hardcopy, double-sided. With answers needing to be written on the test generally in essay format; no computer allowed (and so no real coding involved; it was all about concepts and not about syntax). It covered everyth…

Do you mean by hand, with a pen? The least I would do is politely decline such an interview. I would be sorely tempted to give them the choice between letting me use a keyboard or hearing from an ADA lawyer.

Why so aggressive? What's the problem with the pen? The idea the OP proposes is to use it as a spring board to get a discussion going, I'm sure a pen, a keyboard or a interpretive dance would all work for what they're proposing

Re: I cheated on my Microsoft interview (2019)

#208
When I interviewed at Microsoft the same thing happened. The final interviewer asked me a question I had already solved while studying.

I told him I had already seen the question before and knew the answer. He said that’s fine and just had me show him the solution.

We used the extra time to just chat about my interests and side projects and I got the offer anyway.

So it doesn’t matter, you didn’t “cheat” any more than I did.

Re: I cheated on my Microsoft interview (2019)

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

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 time.

Most people seem to come up with something like this:

  array = [1, 2, ..., 52]
  for i = 0 to 51
    j = random(0,51)
    swap(array[i], array[j])
  print(array)
That has bounded time (constant time assuming random and swap are constant time). Unfortunately not all permutations are equally likely.

We can see that all permutations are equally likely by noting that there are 52 iterations of the loop, and each iteration has 52 possible outcomes. That gives us a total of 52^52 possible outcomes. 52! does not divide 52^52, so it is not possible for each of the 52! possible outcomes to be equally represented in the 52^52 outcomes.

To fix this, you can use the same basic idea of going through all 52 places in your array [1, 2, ..., 52] and swapping each with a random location, but instead of swapping the Nth location with a random location in the whole array, swap with a random location that is not earlier in the array.

Then you still have 52 iterations, but now the number of outcomes varies by iteration. The first iteration has 52 outcomes. The second has 51 outcomes. The third 50 outcomes and so on down to that last having only 1 outcome. That gives 52! possible outcomes, all equally likely. We just then have to show that every one of the 52! permutations is among those outcomes which is easy to do, and then we have shown that this is a correct shuffle.

Re: I cheated on my Microsoft interview (2019)

#210
post #200

Earlier quoted context omitted.

On the flip side, we questioned a candidate the usual way with pertinent technical challenges and so on. Then when driving in a van to lunch (our habit was to do a social segment as well as technical) I asked some puzzle questions - add 6 feet to a rope around the world, stretch it out and how far off the ground would it be? and suchlike. He was charmed, we brainstormed some answers and had a fun lunch. Years later,…

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.

Post reply on HN