Amazon Interview Question for Software Engineer / Developers
- 1of 1 vote
Amazon wants to implement a new backup system, in which files are stored into data tapes. This new system must follow the following 2 rules:- anca.grigoras88 February 16, 2015 in United States
1. Never place more than two files on the same tape.
2. Files cannot be split across multiple tapes.
It's guaranteed that all tapes have the same size and that they will always be able to store the largest file.
Every time this process is executed, we already know the size of each file, and the capacity of the tapes. Having that in mind, we want to design a system that is able to count how many tapes will be required to store the backup in the most efficient way.
The parameter of your function will be a structure that will contain the file sizes and the capacity of the tapes. You must return the minimum amount of tapes required to store the files.
Input: Tape Size = 100; Files: 70, 10, 20
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
Interview Type: Written Test
Open Chat in New Window