Amazon | SDE 1 | Round 1 | On Campus | India | Feb 2022

amazon logo
amazon
SDE IIndiaOngoing
February 28, 20220 reads

Summary

I completed my first technical interview for an SDE1 role at Amazon in India during February 2022. I successfully solved the given coding challenge, addressed follow-up questions on complexity, and found the experience positive, receiving an invite for the next round.

Full Experience

As a 4th-year ECE student from a Tier 2 college, I had my first technical interview for an SDE1 position at Amazon through an on-campus opportunity. This took place in India in February 2022. The round began with a brief self-introduction and a discussion about my projects. The core of the interview was a coding problem: Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists.

I implemented a BFS-based solution. I utilized a hashset for wordList entries and another for tracking visited words. Starting from beginWord, I systematically explored 'sibling' words (those differing by one character) using a queue, ensuring they were in the wordList and unvisited. I continued this process until endWord was reached or all possibilities were exhausted. I took about 20 minutes to devise the approach and another 20 minutes to code and explain it. The interviewer then asked me about the time and space complexity of my solution, which I was able to answer correctly. The overall experience was positive; the interviewer was kind and supportive. I've since received an invitation for Round 2.

Interview Questions (1)

Q1
Word Ladder
Data Structures & AlgorithmsHard

Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists.

Example 1:

Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
Output: 5
Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long.
Example 2:
Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
Output: 0
Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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