Amazon SDE II Intern | Hiring Process | [Offer]
Summary
I successfully navigated the Amazon SDE II Intern hiring process, clearing both the online assessment and a challenging interview round to ultimately secure an offer.
Full Experience
My journey to securing an SDE II Intern offer at Amazon started with the online assessment, which was a crucial step as I hadn't been shortlisted in any of the previous 12-15 exams I had attempted. Amazon was the first company to shortlist me, and I managed to clear the entire process in a single go.
ONLINE ASSESSMENT
The online assessment consisted of two questions and had a time limit of 70 minutes.
-
The first question involved operating on an array: selecting a prefix of any length and decrementing each element within that prefix by 1, ensuring no element becomes negative. The goal was to count the maximum number of zeros after all possible operations. For example, given
[3,2,4,4,1], the output should be3. I realized an optimalO(n)solution was required, and fortunately, I managed to figure it out during the exam. -
The second question presented an array of strings and a threshold value. I needed to count the number of segments where the count of vowels was less than or equal to the threshold. For instance, with
["lciy","ttrd","aod"]and a threshold of1, the output is3, considering segments like["lciy"],["lciy","ttrd"], and["ttrd"]. I approached this with a brute-force method, achievingO(n^2)time complexity.
I successfully solved both questions, which led to my shortlisting for the interview round.
INTERVIEW EXPERIENCE
The interview began with a basic introduction, after which we moved directly into Data Structures and Algorithms questions.
-
The first question was a modification of an Easy String problem on GeeksForGeeks. The modifications were: the string only contained lowercase letters, and if a character occurred more than 9 times, I had to return
"9" + "that char"and continue counting. For example,"aaaaaaaaaaaaaabbeee"would output"9a5a2b3e", and"abcde"would be"1a1b1c1d1e". I managed to solve this correctly in a single attempt using anO(n)approach; it felt quite straightforward. -
The second question was exactly the "Check if leaf traversal of two binary trees is same" problem from GeeksForGeeks. Initially, I proposed a wrong approach involving level-order traversal. The interviewer, through a well-chosen sample case, helped me realize my mistake. After that, I was able to figure out the correct approach and implement it.
The interviewer seemed quite impressed with my solutions and indicated he had no further technical questions. He then asked if I had any questions for him. I asked, "What is the definition of a good code according to you sir? When a student writes a code what are the key elements that you look into?" He provided a thoughtful answer, and then informed me that the recruiting team would update me on the next steps, concluding our meeting.
Soon after, I received the fantastic news: I GOT HIRED!!
Interview Questions (4)
Select prefix of any length from an array and decrement each element in that prefix length by 1. Make sure no element becomes negative. Count maximum number of zeros after all possible operations. Sample case :- [3,2,4,4,1] Output:- 3 Explaination:- Select prefix of size 5, [3,2,4,4,1] -> [2,1,3,3,0]. Now choose prefix of size 4, [2,1,3,3,0] -> [1,0,2,2,0]. Now we have to choose prefix of size 1 because 1st index will become negative if we try to make further elements smaller... [1,0,2,2,0] -> [0,0,2,2,0].
Given an array of strings and a threshold value count the number of segments which have count of vowels less than or equal to the value of the threshold. Sample case :- ["lciy","ttrd","aod"] , threshold = 1 Output:- 3 Explaination:- Segments with vowel count less than or equal to 1 :- ["lciy"],["lciy","ttrd"],["ttrd"].
A modification of the GeeksForGeeks Easy String problem. Modifications were: i) String consisted only lowercase letters. ii) If a character occured more than 9 times then we have to return "9" + "that char" and continue counting again. Sample case 1:- "aaaaaaaaaaaaaabbeee" Output:-"9a5a2b3e" Sample case 2 :- "abcde" Output :- "1a1b1c1d1e"