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:
Leadership Principles
Evaluate “A + B + C / 10 + (E + G)” given map (A -> 1, B -> 2, C -> 3, E -> 4, G -> 5)
This is a calculator problem https://leetcode.com/problems/basic-calculator-iii/