Attended the interview process of Microsoft IDC Hyderabad in Feb 2012 @Bangalore(as the panel was here).
Had 4 rounds
Round1:
Some qn related to BST, asked me to convert a BST to singly linked list in place. Asked various approaches and asked me to code it and write Test Cases. They are very particular about Test Cases! and Time Complexity.
After this they asked me to wait for one more round on same day(it was Saturday i guess)
Round 2:
This round started with a qn about hw the MS word will align while u type, so similarly he gave me a string/paragraph and a Buffer, and asked my approach to do the same. Asked me to write code as well as testcases. He was particular about Testcases(mainly failure cases) and Time Complexity of my algo. I was not able to give an optimised/very simple solution but still he was caring about how I was trying to improve the solution I gave I guess.
After this round felt very hungry and asked HR whether I have to stay back or I will go for my lunch(as went there early morning). She checked with the interviewer and told that I can leave and come back tomorrow for my next round(which I haven't expected)
Round3:
Again reached the venue early morning and I had a round with the Program Manager, he asked me how was my previous round and he said how did they go. I told him that I was not able to give optimized solutions there but tried to improve further. He said its fine and gave me some open ended question.
He asked me to design some Data Structure(s) to Manage Memory in a system, then I asked him whether he expect paging and all from me! He asked me to come down n think, then I said whether I should implement Memory Heap. He then said still more down, then I asked him whether to implement malloc and free, he said yes and started thinking. I gave few random solutions but while exlaining him itself I contradicted my self. So at last gave some solution which was convincing for both of us. He asked me to code for it, write Test cases and derive the Time Complexity.
HR asked me whether I can come to Bangalore for final phase of interviews, but I was saying her like if its on weekend it will be gr8, she said its not possible, then I said yes. Later they called me
after 2 days n said that panel is flying to Bangalore and I will be having my final rounds here itself.
In all 3 rounds above I feel that they will be checking your approach and how u r improving it, no one was expecting a optimized solution in one go!.
So the next Thursday I had my final interview.
Round4:
Interviewer was some senior guy, once I reached there HR took me to some conference room where my interviewer was waiting. He didn't ask me any qn like tell me about yourself etc.,
He directly posed a qn in front of me and asked me to solve it.
Given an array U have to return a product array, product array means the product of all the elements in the array except itself.
I/P:
1, 2, 3, 4, 5, 6
O/P:
720, 360,240,180,144,120
It looks simple!(Try to cover cases like if few elements of it are zeros etc.,).First I gave some solution(brute force, as I always do), he said he don't want me to code for it, but optimize it and code. So I came with some solution and he asked me to code for it. So after coding he asked me write Testcases and derive complexity. While writing TCs itself I found my code won't work for some cases, I told him that and he said he said that he is DISAPPOINTED with my coding, I said I can fix them and it took time for me to do that. In the mean while he said he want to play some games on his mobile saying that am very slow in my coding!. But I didn't take those words seriously, as I went there to give my best shot. Later he gave me some clue and came up with one more solution which he asked me to code for. After that he said whether I can improve it further, I said I can and gave him my approach, seems like he was convinced but not completely. He told me that he expected a optimized solution fro me in first go itself, but I told him that this the approach I was following till now. He asked me whether I have any questions, when I asked about my feedback he said like I should know it by this time(the way I have coded etc.,), so i thought I shouldn't ask any questions as I was getting one more question as a response!. So he asked me to leave after that.
I didn't had any hope for that after my final round. But few days back got a mail from MS HR asking to fill some Background verification forms. So donno whether my final interviewer was really expecting alot from me or it was some STRESS interview kind of thing!. So just waiting for their result eagerly...:)
Thought of sharing this as I got inspiration from this kind of posts before I went for the interviews....:)
Thursday, March 8, 2012
My Interview Experience with Amazon
Went through the interview process of Amazon Bangalore in Feb 2012. Got a call after uploading my resume in naukri.com. Asked me to appear for a online test which contained the following 3 qns(duration 2 hrs), u need to code, compile and run their sample input before submitting the solution:
1. BST - Store Inorder Successor of every node in next pointer(some extra pointer in node structure other than left n right), the max element has to store NULL in its next pointer.
2. ReArrange Array as I/P: a1a2a3b1b2b3c1c2c3 O/P:a1b1c1a2b2c2a3b3c3
Example: I/P 1,2,3,4,5,6,7,8,9 O/P: 1,2,7,2,5,8,3,6,9
Only usage of constant extra space is permitted.
3. Question almost similar to this:
You are given a function printKDistanceNodes which takes in a root node of a binary tree, a start node and an integer K. Complete the function to print the value of all the nodes (one-per-line) which are a K distance from the given start node in sorted order. Distance can be upwards or downwards.
Once am done with this, got a call from Amazon HR for F2F interview. It got scheduled on Saturday morning, I had 3 rounds on that day. I was bit tensed as this was my first interview after i came out of campus(before 3 years). But believe me interviewers are very cool, they give enough time to think n the kind of problems they give u, u ll enjoy solving them. Remember that once u give ur solution u have to write code for it(ur preferred coding language).
Round I:
Started with my intro. He asked me what all data structures i know, i told abt linked list,stacks,queus,heaps,binary trees etc., Then he gave me a question on heap:
1. Insert an element in a max heap.(cases lik if its greater than root etc.,), didn't ask me write code.
2. Compare 2 BSTs element wise(not structure wise!). Asked me to give the time complexity, he was particular about the complexities n how i have derived it. Asked me to write code for it.
3. Kreverse a linked list.
Ex: I/P 1->2->3->4->5->6->7->8 and k=2. O/P: 2->1->4->3->6->5->8->7.
U should do this in place(covert given one to expected, should not create a new one).
4. Prove mathematically that thr is cycle in linked list(proof that slow n fast pointers will meet if there is a cycle in single linked list).
Done n was waiting outside to know whether i have to leave or stay back for next round!, as my first interview was expression less..:)
Round2:
From this interview only i got the confidence, I should thank my interviewer as she started saying ike u need not write an optimized code in first go and u can take ur own time. She asked me to write some working code and optimize it later.
1. Asked me what all tree traversals i know and gave me a binary tree which has some extra pointer called next pointer and i need to link the nodes in tree as follows:
I/P:
3
4 5
6 7 8 9
O/P:(Will show only how next pointer of each node shouls be connected)
3->5->4->6->7->8->9
2. Gave 3 operations as part of Least Recently Used Cache
insertion
Deletion
Accessing
Asked me to decide data structures and analyze the running times and asked to improve them as much as possible.
3. For this one i didn't write any code
Given a 2-dim array with characters filled in it and a dictionary in which a word can be searched in O(1) time. Need to print all the words from array which are present in dictionary. Word can be formed in any direction but has to end at any edge of array.(Need not worry much abt the dictionary)
I/P:
a f h u n
e t a i r
a e g g o
t r m l p
O/P:
after
hate
hair
air
eat
tea
Note: Here "egg" is not a dictionary word because its not ending at the edge of array.
After this round felt like even if they reject me I will leave with confidence and happiness as I felt very happy with my answers..:)
But unexpectedly HR came out and said i ll be having one more round and I can have my lunch now(@Amazon office itself.. :), had very less as my stomach was upset on tht day..:P).
Round3:
This guy started asking some HR related qns, so many things were running in my mind like
*how come it could be HR round as i read in lot of blogs saying that there ll be atleast 5-6 rounds.
*whether they are done with me and wanna know the feed back before they send me out etc.,!!
But to clear all my doubts he said "lets come to our technical discussion"..:)
1. Asked me how I will send a Binary Tree structure to some peer node.(U can also think hw I will store a Binary tree structure inside a file, so that someone can read n reconstruct it).
First I said like I will store the inorder and preorder traversals, so that anyone can reconstruct the tree. Then he asked me to do it in single traversal..
2. Few questions he asked like whts my favorite area in computer science and we had a small chat when i said its netow0rking. And also asked few qns lik the biggest challenge i faced in my previous work etc.,
So finally the day came to an end and HR asked me to leave as she said she ll call me for the next round somewhere in the next week. So I left from there feeling happy for myself. And I thought she will call me after 1 or 2 days(and 2 days before my interview). But suddenly I got a call on Monday itself and she was asking me whether i can come over there after some 2 hours and give my next round of interview. Got stunned!!! I said no, but still went there as I felt I should come out of this tension as soon as possible, here I should one guy who gave me some mental strength.
I reached there office at 3pm itself even my interview was scheduled at 4pm(very less traffic and also I wanna relax there for sometime). Got a call from HR to know whether I have started or not, but I told her that i have already reached, then she moved my interview to 3:15pm itself!.
Round4:
This interview also started with some hr related questions like why Amazon etc.,
Gave some question related to trees. Given some array in which every element is an integer representing its parent node, am supposed to derive the height of the tree.
I didn't know that its my final round, ppl say that its a bar raiser round, HR asked me to leave after this round. Then after 3-4 days of waiting I got a call saying that am hired and they asked my personal details. Got an offer from them(pretty descent).
Never thought of giving my first interview to Amazon and never dream t of cracking it!!!....:)
1. BST - Store Inorder Successor of every node in next pointer(some extra pointer in node structure other than left n right), the max element has to store NULL in its next pointer.
2. ReArrange Array as I/P: a1a2a3b1b2b3c1c2c3 O/P:a1b1c1a2b2c2a3b3c3
Example: I/P 1,2,3,4,5,6,7,8,9 O/P: 1,2,7,2,5,8,3,6,9
Only usage of constant extra space is permitted.
3. Question almost similar to this:
You are given a function printKDistanceNodes which takes in a root node of a binary tree, a start node and an integer K. Complete the function to print the value of all the nodes (one-per-line) which are a K distance from the given start node in sorted order. Distance can be upwards or downwards.
Once am done with this, got a call from Amazon HR for F2F interview. It got scheduled on Saturday morning, I had 3 rounds on that day. I was bit tensed as this was my first interview after i came out of campus(before 3 years). But believe me interviewers are very cool, they give enough time to think n the kind of problems they give u, u ll enjoy solving them. Remember that once u give ur solution u have to write code for it(ur preferred coding language).
Round I:
Started with my intro. He asked me what all data structures i know, i told abt linked list,stacks,queus,heaps,binary trees etc., Then he gave me a question on heap:
1. Insert an element in a max heap.(cases lik if its greater than root etc.,), didn't ask me write code.
2. Compare 2 BSTs element wise(not structure wise!). Asked me to give the time complexity, he was particular about the complexities n how i have derived it. Asked me to write code for it.
3. Kreverse a linked list.
Ex: I/P 1->2->3->4->5->6->7->8 and k=2. O/P: 2->1->4->3->6->5->8->7.
U should do this in place(covert given one to expected, should not create a new one).
4. Prove mathematically that thr is cycle in linked list(proof that slow n fast pointers will meet if there is a cycle in single linked list).
Done n was waiting outside to know whether i have to leave or stay back for next round!, as my first interview was expression less..:)
Round2:
From this interview only i got the confidence, I should thank my interviewer as she started saying ike u need not write an optimized code in first go and u can take ur own time. She asked me to write some working code and optimize it later.
1. Asked me what all tree traversals i know and gave me a binary tree which has some extra pointer called next pointer and i need to link the nodes in tree as follows:
I/P:
3
4 5
6 7 8 9
O/P:(Will show only how next pointer of each node shouls be connected)
3->5->4->6->7->8->9
2. Gave 3 operations as part of Least Recently Used Cache
insertion
Deletion
Accessing
Asked me to decide data structures and analyze the running times and asked to improve them as much as possible.
3. For this one i didn't write any code
Given a 2-dim array with characters filled in it and a dictionary in which a word can be searched in O(1) time. Need to print all the words from array which are present in dictionary. Word can be formed in any direction but has to end at any edge of array.(Need not worry much abt the dictionary)
I/P:
a f h u n
e t a i r
a e g g o
t r m l p
O/P:
after
hate
hair
air
eat
tea
Note: Here "egg" is not a dictionary word because its not ending at the edge of array.
After this round felt like even if they reject me I will leave with confidence and happiness as I felt very happy with my answers..:)
But unexpectedly HR came out and said i ll be having one more round and I can have my lunch now(@Amazon office itself.. :), had very less as my stomach was upset on tht day..:P).
Round3:
This guy started asking some HR related qns, so many things were running in my mind like
*how come it could be HR round as i read in lot of blogs saying that there ll be atleast 5-6 rounds.
*whether they are done with me and wanna know the feed back before they send me out etc.,!!
But to clear all my doubts he said "lets come to our technical discussion"..:)
1. Asked me how I will send a Binary Tree structure to some peer node.(U can also think hw I will store a Binary tree structure inside a file, so that someone can read n reconstruct it).
First I said like I will store the inorder and preorder traversals, so that anyone can reconstruct the tree. Then he asked me to do it in single traversal..
2. Few questions he asked like whts my favorite area in computer science and we had a small chat when i said its netow0rking. And also asked few qns lik the biggest challenge i faced in my previous work etc.,
So finally the day came to an end and HR asked me to leave as she said she ll call me for the next round somewhere in the next week. So I left from there feeling happy for myself. And I thought she will call me after 1 or 2 days(and 2 days before my interview). But suddenly I got a call on Monday itself and she was asking me whether i can come over there after some 2 hours and give my next round of interview. Got stunned!!! I said no, but still went there as I felt I should come out of this tension as soon as possible, here I should one guy who gave me some mental strength.
I reached there office at 3pm itself even my interview was scheduled at 4pm(very less traffic and also I wanna relax there for sometime). Got a call from HR to know whether I have started or not, but I told her that i have already reached, then she moved my interview to 3:15pm itself!.
Round4:
This interview also started with some hr related questions like why Amazon etc.,
Gave some question related to trees. Given some array in which every element is an integer representing its parent node, am supposed to derive the height of the tree.
I didn't know that its my final round, ppl say that its a bar raiser round, HR asked me to leave after this round. Then after 3-4 days of waiting I got a call saying that am hired and they asked my personal details. Got an offer from them(pretty descent).
Never thought of giving my first interview to Amazon and never dream t of cracking it!!!....:)
Subscribe to:
Comments (Atom)
