Amazon | SDE3 | NYC | Nov 2019
Anonymous User
1956

Position: SDE3 AWS Group

I will post here as it is still fresh. I finished the interview last week.

DISCLAIMER: I know this post will be "controversial", as I will expose some concerns that I had once I started this process.
Amazon takes the "Frugality" really serious:

  • Doesn't offer decent perks (funny part of my interview, I asked the developer if he got Amazon prime for free, his answer was "hell no, you pay for everything" LOL)
  • For the interview, they put me on the cheapest hotel in NY (bed bugs and dirty bathroom)
  • The offices are depressing, and all the rooms are windowless and fluorescent lights. (feels like a basement)
  • The chairs are ridiculously unconfortable, good lucky working 9-10hours a day on that.
  • People seem to be always in a bad mood and not smiling. (too much stress?)
  • They offered me a bottle of water and a cereal bar for almost 6 hours of the interview on that day. (I didn't touch that cereal bar)
  • Your bathroom break needs to be accompanied by the interviewer (that was awkward, to say the least).
Anyways, you guys are here for the interview stuff, here it goes:

Let me start by saying that I got the traditional Linkedin invitation, online assessment (the same questions mentioned in the other post), and eventually got called to be the on-site interview.

5 Rounds of the interview heavily focused on the 14 Leadership skills. Another half, straight out of LeetCode questions.

On the day of my interview, other 5 guys were interviewing as well, so the pile a bunch of candidates, I guess it was 5 in the morning and 5 in the afternoon for two days.

First Round (AWS Developer) :

Second Round (AWS Senior developer)

  • Amazon leadership principals

  • Integer array representing building heights, you start on the first position, min steps to reach the end. Each position represents how many jumps you can perform https://leetcode.com/problems/jump-game-ii/

    My solution
    class Solution {
    	  int INVALID = Integer.MAX_VALUE;
    	  Map<Integer, Integer> cache = new HashMap<>();
    
    	  public int jump(int[] nums) {
    		return countJumps(nums, 0);
    	  }
    
    	  public int countJumps(int[] nums, int i) {
    		if (cache.containsKey(i))
    		  return cache.get(i);
    
    		if (i >= nums.length - 1) {
    		  cache.put(i, 0);
    		  return 0;
    		}
    
    		if (i > 0 && nums[i] < nums[i - 1])
    		  return (cache.containsKey(i) ? cache.get(i) : INVALID);
    
    		for (int k = 1; k <= nums[i] && i + k < nums.length; k++) {
    		  int temp = countJumps(nums, i + k);
    
    		  if (temp != INVALID && temp + 1 < (cache.containsKey(i) ? cache.get(i) : INVALID))
    			cache.put(i, countJumps(nums, i + k) + 1);
    		}
    		return cache.containsKey(i) ? cache.get(i) : INVALID; //needs recheck the cache.
    	  }
    }

Third round (with an AWS Architect)

  • Amazon leadership principals
  • Design a Loyalty Program system (good lucky trying to design something better than this guy that has a ton of experience on this specific, also in 10-15 minutes LOL)

Fourth Round (AWS Commerce Manager)

  • Only Amazon leadership principals questions. (tell me about a time... )

Fifth Round (AWS Manager)

  • Amazon leadership principals

  • Given a matrix with integers, each cell represents a ground elevation, after the rain lakes are formed. Find how many lakes were formed. A lake is an elevation where the four cardinal directional cells are higher. The borders are Negative INF. Similar to https://leetcode.com/problems/number-of-islands/

    My solution
    public class NumberOfLakes {
    
      int[][] coord = new int[][] {{0, 1 }, {0, -1 }, {1, 0 }, {-1, 0 } };
      int countLakes(int[][] m) {
    	if (m == null || m.length == 0 || m[0].length == 0)
    	  return 0;
    	int count = 0;
    	boolean[][] visited = new boolean[m.length][m[0].length];
    
    	for (int i = 1; i < m.length - 1; i++) {
    	  for (int j = 1; j < m[0].length - 1; j++) {
    		if (visited[i][j]) continue;
    		count += isLake(m, i, j, m[i][j], visited) ? 1 : 0;
    	  }
    	}
    	return count;
      }
    
      boolean isLake(int[][] m, int i, int j, int value, boolean visited[][]) {
    	if (i <= 0 || j <= 0 || i >= m.length - 1 || j >= m[0].length - 1) return false;
    	visited[i][j] = true;
    	for (int[] c : coord) {
    	  int x = i + c[0];
    	  int y = j + c[1];
    	  if (x < 0 || y < 0 || x >= m.length || y >= m[0].length) continue;
    	  int v = m[x][y];
    	  if (v < value) return false;
    	  else if (visited[x][y]) continue;
    	  else if (v == value && !isLake(m, x, y, value, visited))  return false;
    	}
    	return true;
      }
    }

image

Comments (3)