Amazon Interview Question
Software Development ManagersCountry: India
Interview Type: In-Person
Assumption : Files/Folders having same name are duplicates
In the cloud server we maintain a database which contain files/folders name with their addresses , when there is a need to syn a file we first check weather it's name is resent in our database, or not, if yes then we just create a shortcut in the file's corresponding folder(in cloud server) and this shortcut point to the corresponding file which is some where in cloud server, Now when we got a folder where all it's file are shortcut, we create shortcut of that folder insteed of having a folder which contain files as shortcut, so this will helps in reduction of further space,
Use a hashing mechanism e.g sha-1 or MD5SUM. Dropbox do the same thing( don't know exactly which hashing algo they use but it only stores one version of file even if its uploaded by multiple users till they have same hash ).
- Cerberuz January 17, 2013