Amazon | SDE1 AWS | Seattle

Status: 2 YOE
Position: SDE1 at Amazon
Location: Seattle, WA

Onsite 5 rounds (the lunch does not count)

Round 1:

Round 2:

Round 3:

  • Leadership Principles

  • Return the index of duplicate letter.

  • Given the inefficient function, optimize it (you may use more space) but make sure the optimized function works EXACTLY the same as the old one

    int inefficientOne(string s) {
      for (int i = 0; i < s.size(); ++i)
    	for (int j = i + 1; j < s.size(); ++j)
    	  if (s[i] == s[j]) return i;
      return -1;
    }

    The gotcha here is that you should be careful with the edge cases like “baab”
    The inefficient one returns 0 but if you didn't catch this and you're not careful with the hashmap it would return 1.

Round 4:

Round 5:

Comments (6)