Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

301–310 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#301
post #281

Earlier quoted context omitted.

add 6 feet to a rope around the world, stretch it out and how far off the ground would it be is this a technical puzzle/question? to me it reads like a middle school geometry question. it would be fun to discuss it with friends/colleagues but I wouldn't expect it during a software engineering interview

https://mathimages.swarthmore.edu/index.php/Rope_around_the_... > Although finding the answer requires only basic geometry, even professional mathematicians find the answer strangely counter-intuitive. I guess the more a visual person you are the more counter-intuitive it is. That only 6 feet of rope is needed to widen the radius of Earth at every place at continents and oceans ect at a whole 1 feet seems crazy to me…

sure, the answer might seem counter-intuitive but the method to find the answer is not, as long as you know the connection between a circle's circumference and its diameter

I still fail to see how this is relevant for a technical interview, assuming that we're trying to hire a software engineer. Fun, but not relevant.

Re: I cheated on my Microsoft interview (2019)

#302

Earlier quoted context omitted.

I failed to practice answering questions that I already knew the answer to. I also think the interviewers style had something to do with putting me off balance (it became adversarial after I pointed out this was just alien dictionary, I probably would have had a better result pretending not to have seen the problem before). Or maybe that’s just how things are at Amazon? My Google and Facebook interviews went much bet…

> I failed to practice answering questions that I already knew the answer to. You failed for the same reason you would have failed if you had never heard the problem before. Knowing the answer has nothing to do with why you were dinged.

The interviewer turned really adversarial when I told her this was a common LeetCode problem. I guess you really had to have been there. Alien dictionary isn’t that hard otherwise, if I were allowed to work through it rather than explaining how it worked, things would have gone much better.

Re: I cheated on my Microsoft interview (2019)

#303
As an interviewer I've seen candidates immediately recognize my interview question (let's be honest, with Leetcode unless you invest time to keep crafting new questions, sooner or later it gets leaked).

The interesting part is that you can still get enough signal to tell who understood the solution vs who only memorized it. (e.g. in my question you had to do a pre-processing to transform it into a classical question on leetcode; people who only memorized the solution wouldn't even recognize that and would find the input does not "fit" into the canned solution)

Re: I cheated on my Microsoft interview (2019)

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

Hopefully you told them why you declined, otherwise they will just keep asking those questions of other people.

If companies told candidates why their applications were denied, sure, I'd be inclined to share my side. They don't, so fuck 'em. Play stupid games, win stupid prizes.

Re: I cheated on my Microsoft interview (2019)

#305
post #42

Unless I'm misreading, the question as stated in the blog post never says there is only one duplicate (there might be many!), so in that sense I think his answer may be wrong. A more robust solution is just to have an array of n counters and just count how many times each item appears.

The length is n+1 and contains all ints 1 through n, so there can only be a single duplicate.

But does the question ever say "all"...?

Re: I cheated on my Microsoft interview (2019)

#306

Earlier quoted context omitted.

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…

In every interview I've done, lunch was explicitly bracketed by "this is a free, casual lunch that won't affect your interview at all".

And as an interviewer, I've never been asked to report on lunch chats.

> You're not my peer. We're not having fun.

Actually, most interviewers are your peers, and they typically know that you're under interview stress and are trying to help. If you can't take a break and de-stress during lunch, you're just hurting yourself.

Re: I cheated on my Microsoft interview (2019)

#307
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.

I mean, obviously exceptions were frequently made for folks with special needs or just personal preferences. I’m aware of many times that was done for both situations.

I assure you that I’m not a monster and I would really appreciate it if you’d assume positive intent in such replies.

Re: I cheated on my Microsoft interview (2019)

#308
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.

Hilarious. Python's random module has a built-in shuffle.

Re: I cheated on my Microsoft interview (2019)

#309
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.

This post is so American: entitlement, passive aggressive and lawyers . Oh my.

In most of the world a "no thanks I pass" will suffice

Re: I cheated on my Microsoft interview (2019)

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

OT: I once wondered if normal human shuffling could actually achieve all possible permutations, where by "normal human shuffle" I mean take a deck of cards, split it into two roughly equal piles, and then merge the two piles by repeatedly taking the bottom card from one then the other, with some sloppiness in the "take the bottom card" part so that sometimes you might take more than one card but not too many.

The answer is yes. Here is a way to do it, although it is not very efficient.

Let P be a shuffle where the deck is divided exactly in half, and the merge perfectly alternates one card at a time between piles, starting with the half that was in the bottom before the cut. Let S(n) be a shuffle that is almost a P shuffle except that when the cards that would end up at locations n and n+1 in the P shuffled deck are at the bottom of their piles we drop them in the opposite order then go back to the normal drop order.

S(n) counts as a normal human shuffle. The result of an S(n) shuffle is the same as doing a P shuffle followed by swapping the cards at positions n and n+1 in the P shuffled deck.

If you take any deck and apply the same shuffle repeatedly you eventually get back to where you started. For example doing P 8 times brings you back to where you started. Let O(R) be how many shuffles it takes for shuffle R to come back to where it started, so O(P) = 8.

If you do O(S(n))-1 applications of S(n), then P, then one more S(n), that brings you back to where you started except that the cards at n and n+1 are swapped.

With this we have the capability to exchange adjacent cards in a deck. Any permutation can be reached by a sequence of adjacent exchanges, and thus normal human shuffling can reach every permutation.

As I said this method is not very efficient. The swap of n and n+1 by this method takes 120 shuffles if n is 22 or 28, 72 shuffles if n is 0 or 50, 56 shuffles for 1 or 49, 40 shuffles for 16, 17, 33, or 34, and 16 shuffles for any other n.

Putting the whole deck in a given order would then take tens of thousands of shuffles. Inefficient indeed!

That raises the question of how many normal human shuffles does it actually take to reach a given permutation? What permutation requires the most normal human shuffles?

Post reply on HN