Live data from Hacker News

That time when I failed the Microsoft interview

ochagavia.nl

181–190 of 322 posts

Re: That time when I failed the Microsoft interview

#181
post #81

Just don't ask brain teasers when you conduct an interview; I believe they give no valid signal at all, and I also believe Microsoft does not ask them anymore. The coding questions that require an "aha!" moment are very similar to brain teasers, and should also be avoided. When I conducted interviews for FAANG, I asked somewhat simpler coding questions, something around DFS and/or topological sorting (without calling…

> The coding questions that require an "aha!" moment are very similar to brain teasers, and should also be avoided.

I remember an MS interview I failed in 2015 or thereabouts:

As part of the interview, they asked "how would you find the kth element from the end of a singly-linked list in the shortest time", and they strongly implied that size() followed by counting forward was not what they were looking for, and that they were expecting constant space.

I didn't know the answer, and failed. I don't know if I failed because of it, but anyway.

So I went home and looked up the intended solution, which is the dual iterator, advance one k times then repeatedly advance both one step. After a bit of thought I realized that the time complexity is the exact same as the naive size() + count.

With size(), you do n traversals to get the number of elements, then you do n-k to get your iterator to the desired position. With dual iterators, you advance one n times and the other n-k times. Same deal, total number of steps is 2n-k no matter what, and linked lists usually aren't sequential in memory, so there are no cache benefits favoring one over the other.

There are other advantages to dual iterator-like algorithms (e.g. if it's a stream, you cache the k last seen values and pass only once at the cost of O(k) space; or if it's paging from very slow storage, it pages less due to locality). But they didn't say anything to indicate they were doing a stream. They were, essentially, just reading a puzzle from a book and expecting a particular solution.

Re: That time when I failed the Microsoft interview

#182

My favorite (probably apocryphal) Microsoft brain teaser question I've heard is, "If you had to move Mt Fuji, how would you do it?" I've never interviewed there, or been asked that question, but I think it would be a lot of fun to answer.

> "If you had to move Mt Fuji, how would you do it?" Wait 1s.

[deleted]

Re: That time when I failed the Microsoft interview

#183

Earlier quoted context omitted.

The water level decreases, along with the shore and anything with it falling within the event horizon. Any other apocalyptic brain teasers?

I think a microscopic black hole would evaporate very quickly from Hawking radiation, so the result might be more bang than suck.

Sure, but the mass is not specified so I just assumed the closest one to cosmic horror.

Re: That time when I failed the Microsoft interview

#184
post #86

Earlier quoted context omitted.

First one water is lower. Ball is more dense than water, in boat displaces its weight in water, in water displaces it's volume Dip for hill roll is faster

First one depends on the bowling ball. Most alleys have balls ranging from 7lb to 16lb, all the same volume, and the crossover point where they’d sink is 11.6lb. If it was a floating bowling ball, the lake water level would stay the same when you toss it from a boat. If it were a sinking one, it would decrease.

I think you're counting the overall sphere as the volume, but water would leak in through the finger holes so only their actual material counts. I suspect different weight bowling balls generally have different volumes.

Re: That time when I failed the Microsoft interview

#185

A friend told me about his AWS interview experience. It was a case study describing a potential client, their needs, limitations, etc - trying to be “realistic”. In the end it came down to either pressuring the client to embark on a complex cloud transition in time for a major sports event (that was a make or break event for the customer) or, as my friend recommended, start with a PoC but do the risky transition afte…

> He didn’t get the job because even though the technical attributes were all good, he should have pressured the customer. 1) Is this word for word what they told him? 2) If so, why did he believe them?

These are good questions to ask.

1) I rarely get any feedback, particularly not feedback as detailed as this, with a single reason for failure 2) Employers habitually bend the truth around interviews: interviewing for jobs that don't exist, that are already filled, reneging offers 3) Not being hired after an interview doesn't mean you failed it. They're more like dates than exams.

Re: That time when I failed the Microsoft interview

#186

Once long ago when I interviewed at Apple I was asked the classic "fork in the road, two guys, one always tells the truth and one always lies" riddle, with complete earnestness as far as I could tell. Possibly the single worst interview question I've ever been asked. Of course I told the interviewer I'd heard it before and then gave the correct answer. In my case we just ended up chatting about previous experience in…

This reminds me of the weirdest interview I ever had (boutique software agency, maybe 30 devs).

I walk in, and the CEO's secretary hands me an IQ test and says I have one hour. I do the test, then I meet the CEO and we chat about general topics while she grades the test nearby. Then she announces my IQ, and the CEO says "hmm, yes, that's above the minimum I'd consider for a developer." Then for the last few minutes he goes through the 2-3 questions I got wrong and asks me to explain why I gave the answer I did.

That was the first and only interview, and about six weeks later they call me back in and the CEO made an offer. I reply that I'll need a few days to consider. CEO: "What? Why??"

Re: That time when I failed the Microsoft interview

#187
post #141
post #127

Earlier quoted context omitted.

> something around DFS and/or topological sorting (without calling it by name, of course), because those are thing which you might actually need to implement at work: people sometimes traverse JSONs, and people sometimes resolve dependencies. No one has ever told me "oh, I know this problem, it's DFS", because surely I know they know it. Well, I've been coding for 15 years (of course walking through data structures,…

I understand where you're coming from and can empathize because I've been asked some absurd computer science questions in interviews. However, in my experience, if an interviewer can't confirm basic knowledge of data structures and algorithms, then some lead ends up having to teach computer science to explain to a developer why their code with 5 nested loops is probably not a good idea. Having been that lead who has…

> an interviewer can't confirm basic knowledge of data structures and algorithms

agreed. However, as I read the parent's post, they did not immediately see that DFS was an acronym for a basic algorithm. Given their implied background in computer security, a field littered with thousands of abbreviations (very few of which are basic algorithms) it is understandable that they needed a minute to see what DFS meant.

I could alternately ask a number of python developers if they were familiar with Javascript object notation, and cause a panic because they aren't familiar with javascript. Interviews are stressful. If your field always call it 'json' or 'a dict', you might not immediately make the connection.

Re: That time when I failed the Microsoft interview

#188

A friend told me about his AWS interview experience. It was a case study describing a potential client, their needs, limitations, etc - trying to be “realistic”. In the end it came down to either pressuring the client to embark on a complex cloud transition in time for a major sports event (that was a make or break event for the customer) or, as my friend recommended, start with a PoC but do the risky transition afte…

> He didn’t get the job because even though the technical attributes were all good, he should have pressured the customer. I'd say he didn't get the job because they would have asked him to pressure customers day in day out, he would refuse, never get promoted and be otherwise miserable in an aggressive culture. IMHO he shouldn't change his answer to please the interviewer, the process is working as intended and I'd…

I've too many wacky interview stories to list here, but the first time I came to this same conclusion was when I had an interviewer interrupt me mid-answer to correct my pronunciation of "idempotent" (because I said it in what is apparently a more British fashion). I asked him to repeat himself to see if he'd apologize or brush it off as a tic and he repeated himself with an elevated level of contempt. I declined the offer, that company got bought by McKinsey a year later, and everybody lived happily ever after.

Re: That time when I failed the Microsoft interview

#189

Earlier quoted context omitted.

The water level decreases, along with the shore and anything with it falling within the event horizon. Any other apocalyptic brain teasers?

You drop a bowling ball off a space boat into a black hole. Has the amount of mass inside the universe increased, decreased, or stayed the same, ignoring the effects of all other changes?

I'm not sure what other effects I should ignore, but the mass would increase. The ball gains relativistic mass as it accelerates towards the black hole.

PS: Assuming the boat isn't falling too (it's still in orbit), dropping the ball does nothing. You need to decelerate it (reduce it's orbital speed) for it to fall into the black hole.

Re: That time when I failed the Microsoft interview

#190

Earlier quoted context omitted.

I find it very easy to solve some of these physics questions by thinking about a degenerate version of it instead, with exaggerated parameters (since these physics phenomenons are described by continuous/monotonic functions). So for the bowling ball, I replace it with an imaginary marble weighing 1 ton and the answer is now self-evident.

Will a one ton marble embed into the lake bed?

Why does it matter?
Post reply on HN