Amazon Onsite Interview SDE1 Seattle AWS

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

Onsite 5 rounds (the lunch does not count)

  1. Leadership Principles + SDI
    Design parking lot system
  2. Leadership Principles + Coding
    Reverse string using recursion
    Number of island but 8 directional instead of N, E, S, W
  3. Leadership Principles + Coding

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.

  1. Leadership Principles + Coding
  1. Leadership Principles + Coding

Evaluate “A + B + C / 10 + (E + G)” given map (A -> 1, B -> 2, C -> 3, E -> 4, G -> 5)

  • Solve using stack
  • Solve using recursion
  • Solve using tree

This is a calculator problem https://leetcode.com/problems/basic-calculator-iii/

1 Like