Pergunta de entrevista da empresa Mozilla

Starting from a top level directory how would you find files having same content ?

Respostas da entrevista

Sigiloso

13 de jul. de 2013

by providing the network path of that file in the directory and search. for example:- E:\folder\file.ext in this way we can search.

Sigiloso

12 de jun. de 2016

pick a good hashing algorithm. create an empty hash map string -> [ string ] walk the directory structure( BFS), for each file: let h = hash(file) if map[h] does not exist: create key h in map. push the file path into map[h] each key in the hash map will contain all files with sam content

Sigiloso

13 de jul. de 2013

Dude! I think you din't understand the question correctly.. How will you know that which all files have same content? you should apply some algorithms or data structure to solve this problem...