amazon logo
Amazon路 SDE II Intern

Amazon SDE II Intern | Hiring Process | [Offer]

Result
Offer
Posted
27 Aug 2024
269 reads

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.

How it went

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.

  1. 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 be 3. I realized an optimal O(n) solution was required, and fortunately, I managed to figure it out during the exam.

  2. 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 of 1, the output is 3, considering segments like ["lciy"], ["lciy","ttrd"], and ["ttrd"]. I approached this with a brute-force method, achieving O(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.

  1. 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 an O(n) approach; it felt quite straightforward.

  2. 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!!

Questions asked (4)

  1. 01

    Maximize Zeros in Array by Prefix Decrement

    Data Structures & Algorithms

    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].

  2. 02

    Count String Segments with Vowel Count Below Threshold

    Data Structures & Algorithms

    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"].

    Open the problem
  3. 03

    Run-Length Encoding with Count Cap

    Data Structures & Algorithms

    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"

    Open the problem
  4. 04

    Check if Leaf Traversal of Two Binary Trees is Same

    Data Structures & Algorithms

    Exact Same question was asked as on GeeksForGeeks: Check if leaf traversal of two binary trees is same.

    Open the problem

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!