Amazon | SDE2 | Seattle | Apr. 2020 [Offer]
Anonymous User
5533

Status: 6 years of data engineer experience in a pension fund (Canada)

Online Assessment

  1. Top K Frequently Mentioned Keywords - https://leetcode.com/discuss/interview-question/542597/
  2. Min hours to send file to all available servers - https://leetcode.com/discuss/interview-question/411357/

Virtual Onsite (5 rounds)

Round 1:

Given a binary tree, return the bottom view of the tree as an array of values.
* If the horizontal position of a node is x, its left child node's horizontal position would be x-1 and right child's horizontal position would be x+1.
* If 2 nodes have the same horizontal position, the node on the lower level will block the upper one in the view.
* If 2 nodes on the same level have the same horizontal position, the node to the right will block the one to the left in the view.

Example:
      1
    /   \
   2     3
 /   \    \
4     5    6
Input: [1, 2, 3, 4, 5, null, 6]
Output: [4, 2, 5, 3, 6]

Round 2:

  • This round was entirely LP questions. Can't remember how many were asked. (~55 min)

Round 3:

  • 2~3 LP Questions (~20 min)
  • Coding Question: Implement colour formats conversion library (~35 min)
  • This question is a combination of algorithm and OOD. Implementation of each method is easy. The focus is to write clean object-oriented code with proper class, class properties, and method signatures defined.
  • Related Problem: https://leetcode.com/problems/convert-a-number-to-hexadecimal/
Implement a library that converts amongst the following 3 colour formats:
* RGB, e.g. (20, 200, 100) where each integer is between 0-255
* Floating Point, e.g. (0.023213F, 0.0322376F, 0.7628F) where each float number is between 0-1
* Hex, e.g. "#14C8F3"

Lunch Break (1 hr)

Round 4:

  • 2~3 LP Questions with many follow-ups (~40 min)
  • Coding Question: Find the heavier ball in N balls (~15 min)
  • Similar Problem: https://leetcode.com/problems/guess-number-higher-or-lower/
  • This is a standard binary search problem, but the interviewer asked for an implementation faster than binary search.
  • The solution is essentially to divide the balls into 3 portions (instead of 2) - Ternary Search. Weighing between the first 2 portions, if they weigh the same, search the 3rd portion. Otherwise, search one of the first 2 portions that weighs more.
Given an array of N balls, implement an algorithm to find the one ball that is heavier.
We may assume there is one and only one ball that is heavier while the rest of the balls have equal weight.

The following helper function is given:
/* Returns -1 if first portion is heavier, 1 if second, 0 if equal. */
public int Weigh(Ball[] balls, int start1, int end1, int start2, int end2);

Input: an array of Ball objects, but we don't have access to Ball's properties.
Output: the index of the Ball that is heavier than others.

Round 5:

  • 2~3 LP Questions with some follow-ups (~30 min)
  • System Design Question: Design the coupon code functionality on the Amazon checkout page (~25 min)
  • Assuming not to worry about the generation of the coupon codes.

Result: downgraded offer to SDE1

My Takeaways:

  • In general, the 3 coding questions were all pretty straightforward and I believe I answered them all pretty well.
  • In terms of LP questions, I believe I didn't prepare that well. I only spent 2 days writing up examples and practicing in my head (did not practice out loud at all). Also, I believe my current experience as data engineer in a pension fund might have resulted in some of my examples not as relevant to SDE role.
  • The system design question appeared to be rather simple, so I could have missed some important points or considerations.

Some LP questions that I can still remember:

  • Give an example of helping some project / someone beyond your job responsibility.
  • Give an example of a challenging / complex project.
  • Give an example of pushing for a more optimal solution but failed.
  • Give an example of reaching out for someone else who is a subject matter expert to help with something you are working on.
  • Give an example of working towards an impossible / tight deadline.
  • Give an example of not able to complete something before committed deadline.
  • Give an example of an innovative solution you came up with and completed.

Preparation:

Comments (8)