# Amazon Experienced Interview, NYC (Assessment + Phone)

Assessment:

1. There’s an Amazon Media Encoder that splits a file into several sub-files of different sizes and a Decoder that puts them back together. The Decoder can merge any two sub-files into one and time it takes is the size of the merged sub-file. Given a list of N integers representing the sizes of the subfiles, what is the fastest possible time for the Decoder to merge all of the files together?

i.e. Given the file sizes 3, 5, 12, 9, 1; The time it would take is 61.

1. You have a robot in the top-left corner of a grid of land. The grid is made up of flat land you can travel on, trenches you cannot travel on, and a pile of garbage that the robot has to reach to clean. Given the layout of the grid, what the shortest distance to the garbage?

i.e. F = Flat, T = Trench, G = Garbage, this grid would take a distance of 8:

F T G F
F T T F
F F F F

Phone: Both Questions involved a tree representing the hierarchy of Amazon management. CEO being the root, and you being somewhere in tree. Each node contains the employee’s name and income. i.e.

1. Of the employees on your level, what are the salaries that are greater than yours?
2. Who’s subtree has the largest average income? (Including the root of the subtree)

I rejected afterwards despite feeling that I performed strong in the phone interview. The interviewer was pretty disengaged the whole time. He didn’t ask me to run the code or about time complexity even though we had ~10 minutes in the interview left. I brought it up with my recruiter but they didn’t second guess him. If I could back go back in time I would have asked to reschedule so I’d get an interviewer who wasn’t prepared to reject me.