Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

91–100 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#91
post #30

Earlier quoted context omitted.

Yes, it's a question with a silly trick. Completely useless if one knows the answer, hard to spot if the person feigns struggle. Although, n•(n+1)/2 formula is not necessary. One can start with an xor sum and find the duplicate by xor adding elements again. This is another silly trick.

What is the closed form solution of the xor-sum though?

You already have to spend the time to go through the list. Just add up the xor as you iterate through the list.

Re: I cheated on my Microsoft interview (2019)

#92
Luck has played an outsized role in my life. Two notable examples:

1. In 1992 I learned that a colleague of mine was a member of the Magic Castle [1] and offered me a guest pass. I had a long-standing love of magic, and the chance to go to the Castle seemed like a once-in-a-lifetime opportunity. I invited some friends to go with me, and one of those friends asked if she could bring a friend, and of course I said yes. Fast-forward 30 years and that friend-of-a-friend and I just celebrated our 25th wedding anniversary.

[1] https://en.wikipedia.org/wiki/Magic_Castle

2. In early 2000, at the height of the dotcom boom, I sent a resume to an obscure little startup with about 50 employees. They made me an offer, but I turned them down because I decided that it was not worth giving up my secure position at NASA to go chasing a pipe dream. But they wouldn't take no for an answer. They offered me all kinds of additional perks (back then anyone with a CS degree and a pulse could pretty much write their own ticket) and so I decided to go. Four years later that company had an IPO. Their stock symbol was GOOG.

[UPDATE] Two more examples that I just thought of, with a somewhat different dynamic:

3. When I was in high school I attended a football game. I drove myself in my parents' car. At the game, I met my best friend at the time (who has since died from complications resulting from malaria, but that's another story) who had arrived on a motorcycle. After the game we decided to go meet somewhere (I don't recall exactly where). I followed him. At one point he was stopped at a stop sign. I expected him to pull away from the intersection fairly quickly and I didn't want to lose him, so I stepped on the gas. By the time I realized that he wasn't pulling away as I expected it was almost too late to stop. I screeched to a halt (this was before ABS brakes) with my front bumper about a foot away from his rear wheel. If I had reacted even a second later I almost certainly would have hit him, and quite possibly killed him.

4. After college some friends and I went on a tour of Europe. We rented a car in England and picked up two girls so there were five of us in the car along with our backpacks. One of my friends was driving, and I was in the passenger seat. We were going at speed down a non-divided highway when I saw my friend turn his head to say something to one of the girls in the back seat. The car started drifting into oncoming traffic, which in England of course is on the right. We were heading straight for a semi-truck. In a split my brain decided that telling him to look out might be a bad idea because, as an American driver, his reflex reaction would be to turn the wheel to the right instead of left. So I grabbed the wheel myself and turned to the left. My friend of course did not know realize right away why I had done this. He thought I had just gone rogue, looked at me instead of out the window, and gave my hand a karate chop to get me to let go of the wheel. He never saw the truck. To this day I'm not sure I did the right thing. But we didn't hit the truck.

Re: I cheated on my Microsoft interview (2019)

#93

Every time the topic of cheating comes up on HN, I become increasingly disheartened by the amount of people chiming in who think it's not only alright to cheat but also laudable to do so. Ethics are foundational to engineering. Jettisoning them is a sign of a discipline in decline.

Is it cheating if the person asks his recently hired friend what the interviews were like and he just happens to get the same question?

This is a case of random chance and Microsoft not having a wide enough of an interviewer pool. It didn't seem willful, malicious, or pre-planned on the part of the candidate.

How would you respond in the moment? They admitted they were shocked to see the question. They were probably expending so much mental effort to maintain composure that the thought never crossed their mind on how to appropriately handle the scenario. High stakes and nerves. That's not at all what they prepared for.

Re: I cheated on my Microsoft interview (2019)

#94

Every time the topic of cheating comes up on HN, I become increasingly disheartened by the amount of people chiming in who think it's not only alright to cheat but also laudable to do so. Ethics are foundational to engineering. Jettisoning them is a sign of a discipline in decline.

I desperately wish there were some kind of equivalent to the Bar Association for software. A higher power that can punish blatant ethical violations in the face of the relentless greed of an engineer's boss, company, or industry. I think of the Volkswagen emissions snafu and how that might have been handled differently if the engineers had something with teeth to use to push back against unethical and illegal practices.

On the other hand, I feel that it would be a moot point. 'Ethics violations' require a code of ethics and an intent to violate them. I was recently at a meeting where an engineer was describing how they used an A/B test to prove that creating an extra modal dialogue in the account deletion process reduced the number of people who deleted their account. They described the entire process as being good for the user, who might be 'confused' about 'accidentally' deleting their account and how they would be more 'empowered' to 'remain loyal'. I realized I was listening to someone describe a dark pattern, but this person was convinced that dark was light.

Re: I cheated on my Microsoft interview (2019)

#95
I was at the other end of such an interview once.

Our candidate found us via a college campus job fair and was given a Codility test for screening. He didn't do particularly well, but got through and, unfortunately, was given another Codility test by mistake.

I suppose he got upset at that point and just copied the solutions from a friend, who was also applying(we only had four sets of questions). That score was of course considerably higher, even though he made the exact same mistakes his friend did.

We found out what was going on and had reservations whether to continue with the process, but he was invited to the second round and aced it.

I think he spent around a year with us and left for a much better paid position.

Overall that Codility test was wholly unnecessary (both the first and the second) and got me thinking how many talented people never made it to the second round because of it.

EDIT: I checked that candidate's current LinkedIn profile and at the moment he's a Tech Lead at globally recognized big data analytics company.

Re: I cheated on my Microsoft interview (2019)

#96
post #32

/* Not sure if this is correct, but there should be a solution along these lines will explode if the array contains values outside of 1...n also, invalidates the array */ int v = values[0]; for(;;){ if(v == values[v])return v; int t = v; v = values[v]; values[v] = t; }

Try {2,2,1}

Re: I cheated on my Microsoft interview (2019)

#97

Every time the topic of cheating comes up on HN, I become increasingly disheartened by the amount of people chiming in who think it's not only alright to cheat but also laudable to do so. Ethics are foundational to engineering. Jettisoning them is a sign of a discipline in decline.

Hate the game, not the player

Re: I cheated on my Microsoft interview (2019)

#98
post #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…

I learned this formula before high school. It was considered trivial.

The demonstration was to write the sums 1+2+...N and N+(n-1)+...+1 and add them up position wise. The sum comes n*(n+1)/2 (divide by 2 for the two sums).

Re: I cheated on my Microsoft interview (2019)

#99

Why are all the other comments so negative and stuck up whether it constituted “cheating” or not? That wasn’t the point of this story. It was a beautifully well written account on luck and how sometimes the things align. The interviewee at the time was receptive towards the kind of questions that are asked at Microsoft and got the right one. Good luck. And then he passed a 6 hr on-site interview as well! No luck at a…

Making me thinking what if the author was not lucky enough to pass the initial interview. Well Microsoft just fail the author, and the on-site interview never happens?

I'm feeling that the initial interview might not be completely fair. But of course, many things in life are down to lucks. Good luck helps, I guess.

Re: I cheated on my Microsoft interview (2019)

#100
I recently got interviewed by MS, I met 3 individuals on the team hiring, they discussed what I'd done previously, and what they were doing now.

The first interviewer was focused on culture and values.

The second interviewer asked me to describe how I'd approach pathfinding a simple 2D maze, and explicitly told me that they weren't worried about "best" algorithms like A*, but were more interested in how I'd model the problem in the first place, and seemed happy when I suggested building a graph as a better way to reason about it, and write readable code than just index twiddling a 2D array.

They then asked me to code review a pre-existing index twiddling solution, they liked my suggestions, and I even picked up an error (that didn't seem deliberate) that one of my suggestions would've prevented.

The last interviewer was more interested in architecture, and their only technical question was "name a design pattern you've used and why you used it".

Then they asked me to submit a GitHub repo that translated Roman numerals into Arabic numerals in Go, with a specific requirement to "obey Postel's law".

At the same time, a small medtech firm looking to recruit me for a data engineering role had me meet two engineers for an hour, then complete an online coding test on one of those annoying online editors, where the goal was to calculate waiting times in TypeScript from ISO-8601 formatted strings.

Then I met more of their engineers, got asked trivia like "What's the difference between ETL and ELT?" and then did some live coding on that same annoying online editor to implement the "maximum sub-array" problem before discussing Big-O...

I felt like they'd taken algorithmic questions you'd use for a recent CS grad and applied it to a senior data engineering role where if I'm ever needing to calculate the maximum sub-array in TS, you're doing very many bad things.

So all in all, MS's interview technique felt far more relevant and useful.

Post reply on HN