algorithm - How to answer find duplicates in array extension questions? -
i @ technical interview, given question "find duplicates in array" , solved in o(n) time hashtable no problem, given barrage of follow questions.
orig: determine if array contains duplicate entries. f1: if array large, , had distributed across multiple machines. f2: if network connection between these machines prone failure? f3: if hardware not 100% reliable , may give off wrong answers? f4: design system multiple simultaneous users may need update array, while need maintain uniqueness of entries.
i thought f1 , said wouldn't wise use huge hashtable , trade runtime o(n²) compensate o(1) memory, wasn't sure rest. help?
f2: have duplicate data on different machines, can chose data or part of data.
f3: use checksum values when transferring data between machines.
f4: use kind of synchronisation (like semaphores) make sure updating not done simultaneously.
Comments
Post a Comment