Microsoft Interview
Apr 4 2012
So, this Monday I had an interview with Microsoft. I’ll try to be as descriptive as possible - I know that there are people interested in this, and if you’re reading this before an interview of your own, good luck!
So, I was to meet in Building 111 (One-Eleven) with my coordinator for an SDET position interview. I’ll leave out names for privacy’s sake. After playing for about an hour with various interviewees on an awesome Microsoft Surface 2 in the lobby, the receptionist, another interviewer and I all rocked out on Rock Band 3. We ended up playing “Yoshimi Battles the Pink Robots Pt. 1”. Halfway through, a coordinator came out to meet our drummer, the last interviewee besides myself. The two of them left together, and the receptionist had to go do some business stuff. Since I was still waiting, I decided to sing “Everybody Wants to Rule The World”. Near the end, my coordinator showed up, and we went to his office.
His office was pretty small and dark, and like all the offices I saw at Microsoft, was comprised of three solid walls and a fourth glass wall containing the door. He went over my resume a bit, asked me some pretty generic questions, and then got down to business: I was interviewing for the Windows Live team. The Live team was located in Building 88, I had an unknown number of interviewers because of their schedules, and after I was done interviewing he wanted to talk to me again. So he called a shuttle (A midsized Ford sedan) for me, and it took me to building 88.
Surprise! At building 88, in the lobby, I met the drummer again. Turns out he was interviewing for Project Manager for the Windows Live team. Small world (big campus). I could wholeheartedly wish him luck, since he wasn’t applying for SDET. He left before me yet again, then my interviewer showed up. Hard questions time.
So, this guy used to work on the Hotmail team. That’ll be important later. He asked me a programming question first, which I’ll describe down here:
You have a tic-tac-toe program. Given this method header, solve for checkWin -
public bool checkWin(int col, int row, char piece)
So, I want to go ahead and say that I’ve done tic-tac-toe before, and that was my downfall. I was thinking back to my own generic method so much that I didn’t understand the simplicity of his. I feel I failed this horribly. This is the first solution I came up with:
public bool checkWin(int col, int row, char piece)
{ for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
if(board[i] != piece)
continue;
}
return true;
}
return false;
}
To be honest, I’m not sure that’s exactly what I had, but even that wouldn’t be done. I’d still need to check for vertical, then diags. I kept improving that while I worked on it, trying to reason my way to a better solution, but as long as I didn’t understand that col and row were being passed to me, it was no good. Thinking back makes me realize how stupid I was in that interview.
So, here’s what I -should- have been doing:
public bool checkWin(int col, int row, char piece)
{
if(board[col][0] == board[col][1] == board[col][2])
return true;
if(board[0][row] == board[1][row] == board[2][row])
return true;
if(board[0][0] == board[1][1] == board[2][2])
return true;
if(board[2][0] == board[1][1] == board[0][2])
return true;
return false;
}
I was trying not to brute-force it, but sometimes ya gotta. So after that coding question, he asked me to ‘test’ an elevator. So, I came up with some ways to test it. Test the capacity - load it up until it starts to mess up. Don’t go beyond that weight. Make sure it has a good speed, but that it doesn’t accelerate so much it kills you. Make sure the brakes are good. Pretty general stuff there.
Then here was the last question he asked me. Say you’re on the Hotmail team (told you it was important). You have two bugs, but only time to fix one before release. These are the bugs: Messages sent to multiple recipients will only go to the first recipient. — If you have more than 500 messages in your inbox, your browser will crash.
What to do? He said I was able to ask him anything, so I did. Here’s some info:
Less than 5% of all users have over 500 messages in their inbox.
Over 66% of all messages sent have multiple recipients.
The time it would take to send a message to everyone apologizing for the multiple recipients issue is too long for us to solve the inbox issue and then the recipient issue because of localization (Hotmail has a large user base).
And then I asked: Is there a right answer?
…
He said no.
I ended up going with the recipient issue. I hate it, but it’d impact less people.
So. Back to the lobby (where I met drummer a final time) to wait for my next interviewer. After he arrived (I’ll be honest, it took a while), we went to lunch together in Building 86. The ‘weird’ cafeteria, because you have to pay for your food. I’m not sure if we went there as part of the plan or if it’s because it was closer than The Commons. We got Chinese (the line was short for that one, so I opted for it, but I shouldn’t have - it was actually pretty lousy. I saw plenty of other good food, so I know it isn’t the establishment, just my poor judgment), then got some (FREE) coke and sat down. He asked me about what I was interested in, and I asked him about what kind of work he did. He talked mostly about automating input to systems using C# and PowerShell. We went back to his office for a more official interview.
Coding problem 2. Given an integer array, remove all adjacent repeating integers.
There was a bit of miscommunication, so I was going to write the code for finding the integers and a method to solve it. I think it was just me misunderstanding him (he had a thick Indian accent, probably because he was from India), but I’m pretty sure I lost points for that. He corrected me, and I went to solving it again. I ended up with something like this:
public void removeAdj(int[] intarr)
{
int[] list = new int[intarr.length];
element = 0;
for(int i = 0; i < intarr.length; i++)
{
if(intarr[i] != intarr[i + 1])
list[element++] = intarr[i];
}
...
And then I ran into some problems. I was thinking we could just leave it at that, but then we’d have an excessively long array (assuming we did work) with no way to denote worthless values. I was much too nervous to remember we had ‘element’ for some reason. Oh, somebody hit me in the head with a hammer. He ended up reminding me by something he said that I could use element, but not after I made a fool of myself. I ended up adding this:
...
int[] temp = new int[element];
for(int i = 0; i < element; i++)
{
temp[i] = list[i];
}
intarr = temp;
}
which works fine, but for some reason he didn’t like it. Apparently, he wanted me to just do ‘intarr = list’ before that and do an int return of element to show where there was meaningful information. I have to say, that’s just silly.
ON TO THE NEXT INTERVIEW.
So, this guy and I got along fine, we had similar senses of humor, although I found his social awareness lacking (dude had never heard of Minecraft). He used to be on the Messenger team. For his programming question, I’ll skip ahead and tell you the answer instead of what I fiddled around with (which were all mostly terrible, I assure you).
Say you have a char singly linked list. Remove all recurring nodes. (For instance, if you have AaBCAD, you should have AaBCD).
Short answer - create a hashmap and check on every node if that hash value is filled. If it is, remove that node.
He also had me run through some test cases, which I apparently didn’t supply enough of. It’s 1:22 and I’m getting tired, so I’m not going to go through those.
So, we departed, and I went back to Building 111 via Shuttle. I met with my coordinator briefly (He had a meeting to get to), he asked me how it went, and told me he’d be in touch within a week. I hope to hear from him soon.
Oh, quick tip: In the refrigerator in the lobby of 111, there’s this drink called ‘Kinect’. DONT DRINK IT. ITS BAD.
At least, I didn’t like it. Ended up drinking some Welsh’s Cranberry Juice to get the flavor out. A couple more juices fell out of the fridge and got dented, so I ended up taking those too. Overall, I liked the experience. I was way too nervous to function, though.
Like I said, if you’re reading this in prep for an interview, good luck! Well, so long as you’re not going for SDET on the Windows Live team. At least, not anytime soon.